Skip to content

Remove usage of rfc822 from the stdlib #47098

Closed

Description

@brettcannon
BPO 2849
Nosy @warsaw, @brettcannon, @hdiogenes, @benjaminp
Files
  • remove_rfc822-test_urllib2.py: Removes rfc822 from test_urllib2
  • remove_rfc822-cgi-incomplete.py: First attempt at removing rfc822 from cgi
  • remove_rfc822_from_cgi.patch: Remove rfc822 from cgi module
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2008-06-12.22:16:12.045>
    created_at = <Date 2008-05-14.01:02:03.662>
    labels = ['type-bug', 'library']
    title = 'Remove usage of rfc822 from the stdlib'
    updated_at = <Date 2008-06-12.22:16:12.043>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2008-06-12.22:16:12.043>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-06-12.22:16:12.045>
    closer = 'benjamin.peterson'
    components = ['Library (Lib)']
    creation = <Date 2008-05-14.01:02:03.662>
    creator = 'brett.cannon'
    dependencies = []
    files = ['10375', '10376', '10494']
    hgrepos = []
    issue_num = 2849
    keywords = ['patch']
    message_count = 12.0
    messages = ['66810', '67055', '67056', '67057', '67569', '67597', '67626', '67642', '68046', '68083', '68091', '68103']
    nosy_count = 4.0
    nosy_names = ['barry', 'brett.cannon', 'hdiogenes', 'benjamin.peterson']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2849'
    versions = ['Python 2.6', 'Python 3.0']

    Activity

    1. brettcannon commented on May 14, 2008

      @brettcannon
      MemberAuthor

      The rfc822 module has been deprecated for a while but is still used in the
      stdlib (at least in 'cgi' and 'test_urllib2'). All uses need to go before
      the module can be removed.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on May 14, 2008
    3. hdiogenes commented on May 19, 2008

      hdiogenesmannequin
      Mannequin

      A quick search for rfc822 imports in py3k reveals this:

      $ find . -name '*.py' | xargs egrep -nr '(from|import) rfc822'
      ./Demo/scripts/mboxconvert.py:7:import rfc822
      ./Lib/cgi.py:39:import rfc822
      ./Lib/mimetools.py:5:import rfc822
      ./Lib/test/test_rfc822.py:1:import rfc822
      ./Lib/test/test_urllib2.py:587:        import rfc822, socket
      ./Tools/faqwiz/faqwiz.py:210:            import rfc822
      ./Tools/scripts/mailerdaemon.py:3:import rfc822
      ./Tools/versioncheck/pyversioncheck.py:2:import rfc822

      The real "release blockers" should be cgi, mimetools and test_urllib2.

    4. hdiogenes commented on May 19, 2008

      hdiogenesmannequin
      Mannequin

      Correction: mimetools is also being removed from py3k (bpo-2848).

    5. hdiogenes commented on May 19, 2008

      hdiogenesmannequin
      Mannequin

      Tried to just replace rfc822.Message with email.message_from_file in
      cgi.py but it didn't work. I still have to figure out how to fix
      FieldStorage.read_multi.

    6. hdiogenes commented on May 31, 2008

      hdiogenesmannequin
      Mannequin

      Seems that removing rfc822 from cgi is not an easy task -- please see bpo-1112856.

    7. hdiogenes commented on Jun 1, 2008

      hdiogenesmannequin
      Mannequin

      Added a patch that successfully removes rfc822 dependency from the cgi
      module, using ideas from bpo-1112856. I had to change one test, as the
      email FeedParser ignores trailing spaces in subparts.

    8. hdiogenes commented on Jun 2, 2008

      hdiogenesmannequin
      Mannequin

      With the attached patches, rfc822 won't be used anywhere inside Lib/
      anymore (with the exception of mimetools, which is going away too).

      Is there any reason to convert the files below? Shouldn't they be removed
      from 3.0?
      Demo/scripts/mboxconvert.py -> superseded by mailbox.py
      Tools/faqwiz/faqwiz.py -> really old (1998)
      Tools/scripts/mailerdaemon.py -> still useful?
      Tools/versioncheck/pyversioncheck.py -> really old (1997)

    9. brettcannon commented on Jun 2, 2008

      @brettcannon
      MemberAuthor

      On Sun, Jun 1, 2008 at 8:33 PM, Humberto Diogenes
      <report@bugs.python.org> wrote:

      Humberto Diogenes <humberto@digi.com.br> added the comment:

      With the attached patches, rfc822 won't be used anywhere inside Lib/
      anymore (with the exception of mimetools, which is going away too).

      Is there any reason to convert the files below? Shouldn't they be removed
      from 3.0?
      Demo/scripts/mboxconvert.py -> superseded by mailbox.py
      Tools/faqwiz/faqwiz.py -> really old (1998)
      Tools/scripts/mailerdaemon.py -> still useful?
      Tools/versioncheck/pyversioncheck.py -> really old (1997)

      Probably. I bet both the Demo and Tools directory need a thorough clean-up.

    10. warsaw commented on Jun 12, 2008

      @warsaw
      Member

      Reviewed and applied to Python 3.0 in r64161. The patch did not apply
      cleanly for 2.6. I'm going to bump this down to critical for the first
      betas. Humberto, can you back port it to Python 2.6?

    11. hdiogenes commented on Jun 12, 2008

      hdiogenesmannequin
      Mannequin

      [msg68060]

      > Why does it need to be in 2.6? mimetools is still there.

      I guess you're right, it doesn't.

      So, does it make sense to backport this too?

    12. warsaw commented on Jun 12, 2008

      @warsaw
      Member

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      On Jun 12, 2008, at 4:36 PM, Humberto Diogenes wrote:

      Humberto Diogenes <humberto@digi.com.br> added the comment:

      [msg68060]
      >> Why does it need to be in 2.6? mimetools is still there.
      >
      > I guess you're right, it doesn't.

      So, does it make sense to backport this too?

      No.

      Thanks,

      • -Barry

      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.4.9 (Darwin)

      iQCVAwUBSFGSL3EjvBPtnXfVAQLooAP+PQK6Q9p6lDbmLkBgbQio5CXdckssMMyI
      yvj0DYvK5wBYCurCjOTZ5VFUQZTEloj6p/89qf3HScfUASlIie1vJJRUqCktPDLs
      THBicAS9lUXWLhmrD6ADgaLN88JMlTGnzpe03vBpScgFfy3fp8QHBoMzjud38amn
      ozB6lzB+mAQ=
      =qHGu
      -----END PGP SIGNATURE-----

    13. benjaminp commented on Jun 12, 2008

      @benjaminp
      Contributor

      I've removed the whole module in r64203.

    14. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions