Skip to content

Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 #83855

Closed

Description

@vstinner
BPO 39674
Nosy @gvanrossum, @vstinner, @ezio-melotti, @jamadden, @tirkarthi
PRs
  • bpo-39674: Revert "bpo-25988: Do not expose abstract collection classes in the collections module. (GH-10596)" #18545
  • bpo-39674: Suggest to test with DeprecationWarning #18552
  • bpo-39674: Update collections ABC doc #18747
  • [3.8] bpo-39674: Update collections ABC deprecation doc #18748
  • bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode (GH-16959)" #18767
  • bpo-39674: Fix typo in What's New In Python 3.9 #18776
  • [3.7] Fix collections ABC deprecation notice #25280
  • [3.8] bpo-39674: Fix collections ABC deprecation notice #25281
  • 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 2020-04-23.23:04:03.240>
    created_at = <Date 2020-02-18.11:26:29.040>
    labels = ['3.10', 'expert-unicode']
    title = 'Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10'
    updated_at = <Date 2021-04-08.23:29:27.595>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2021-04-08.23:29:27.595>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-04-23.23:04:03.240>
    closer = 'vstinner'
    components = ['Unicode']
    creation = <Date 2020-02-18.11:26:29.040>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39674
    keywords = ['patch']
    message_count = 13.0
    messages = ['362196', '362220', '362222', '362225', '363195', '363263', '363276', '363277', '363308', '363350', '363367', '367159', '390571']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'vstinner', 'ezio.melotti', 'python-dev', 'jmadden', 'xtreak']
    pr_nums = ['18545', '18552', '18747', '18748', '18767', '18776', '25280', '25281']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39674'
    versions = ['Python 3.10']

    Activity

    1. vstinner commented on Feb 18, 2020

      @vstinner
      MemberAuthor

      Following discussion on python-dev, I propose to revert the removal of a few deprecated functions to keep them in Python 3.9, and only remove them in Python 3.10. Please see the following email for the longer rationale, and the discussion for further details:

      https://mail.python.org/archives/list/[email protected]/thread/EYLXCGGJOUMZSE5X35ILW3UNTJM3MCRE/

      With Python 3.8, it was possible to have a single code base working on Python 2.7 and 3.8. Some functions emits DeprecationWarning, but these warnings are ignored (silent) by default. With removed deprecated functions in Python 3.9, *new* code is required to support Python 2.7. The problem is that Python 2.7 is no longer supported. Adding new code to support Python 2.7 sounds painful. Dropping Python 2.7 support isn't free. Projects have to drop Python 2 code, drop CI tests on Python 2, warn users, etc.

      The idea is to give maintainers one more year (until Python 3.10) to organize their project to schedule properly the removal of Python 2 support. The first motivation is to ease adoption of Python 3.9.

      --

      I propose to start with reverting the removal of collections aliases to Abstract Base Classes (ABC) like collections.Mapping alias to collections.abc.Mapping. Removing these aliases is the change which caused most issues when testing Python projects on Python 3.9.

      I also propose to modify the What's New In Python 3.9 document to strongly suggest to test your applications with -W default or even -W error to see DeprecationWarning and PendingDeprecationWarning.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Feb 18, 2020
    3. gvanrossum commented on Feb 18, 2020

      @gvanrossum
      Member

      Yes please.

      I have one exception. I f we manage to get the new parser (pegen) in, we have to remove the old parser module.

    4. vstinner commented on Feb 18, 2020

      @vstinner
      MemberAuthor

      New changeset af5ee3f by Victor Stinner in branch 'master':
      bpo-39674: Revert "bpo-25988: Do not expose abstract collection classes in the collections module. (GH-10596)" (GH-18545)
      af5ee3f

    5. vstinner commented on Feb 18, 2020

      @vstinner
      MemberAuthor

      PR 18552 adds a section to What's New In Python 3.9 to strongly advice to check for DeprecationWarning in your Python projects.

    6. vstinner commented on Mar 2, 2020

      @vstinner
      MemberAuthor

      Andrew Bartlett of the Samba project asked to revert the removal of the "U" mode:
      https://bugs.python.org/issue37330#msg362362

      We should consider to revert the removal, and only remove the "U" mode in Python 3.10.

    7. vstinner commented on Mar 3, 2020

      @vstinner
      MemberAuthor

      Another candidate is to revert the ignored "U" mode in open(): commit e471e72 of bpo-37330.

      Removing "U" mode of open() broke 11 packages in Fedora:

      • aubio
      • openvswitch
      • python-SALib
      • python-altgraph
      • python-apsw
      • python-magic-wormhole-mailbox-server
      • python-munch
      • python-parameterized
      • python-pylibmc
      • python-sphinx-testing
      • veusz

      Keeping "U" mode in Python 3.9 is also a formal request from Andrew Bartlett of the Samba project: https://bugs.python.org/issue37330#msg362362

    8. vstinner commented on Mar 3, 2020

      @vstinner
      MemberAuthor

      New changeset 91fe414 by Victor Stinner in branch 'master':
      bpo-39674: Update collections ABC deprecation doc (GH-18747)
      91fe414

    9. vstinner commented on Mar 3, 2020

      @vstinner
      MemberAuthor

      New changeset 2aa694d by Victor Stinner in branch '3.8':
      bpo-39674: Update collections ABC deprecation doc (GH-18748)
      2aa694d

    10. vstinner commented on Mar 3, 2020

      @vstinner
      MemberAuthor

      New changeset 116fd4a by Victor Stinner in branch 'master':
      bpo-39674: Suggest to test with DeprecationWarning (GH-18552)
      116fd4a

    11. vstinner commented on Mar 4, 2020

      @vstinner
      MemberAuthor

      New changeset a6d3546 by Victor Stinner in branch 'master':
      bpo-39674: Fix typo in What's New In Python 3.9 (GH-18776)
      a6d3546

    12. vstinner commented on Mar 4, 2020

      @vstinner
      MemberAuthor

      New changeset 942f7a2 by Victor Stinner in branch 'master':
      bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode (GH-16959)" (GH-18767)
      942f7a2

    13. vstinner commented on Apr 23, 2020

      @vstinner
      MemberAuthor

      I close this issue.

      So far, it seems like the number of incompatible changes in Python 3.9 is reasonable. If more incompatible changes should be reverted, I suggest to open new issues.

    14. added and removed
      stdlibStandard Library Python modules in the Lib/ directory
      on Apr 8, 2021
    15. vstinner commented on Apr 8, 2021

      @vstinner
      MemberAuthor

      New changeset 20d56bd by Markus Gerstel in branch '3.8':
      bpo-39674: Fix collections ABC deprecation notice (GH-25281)
      20d56bd

    16. 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

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions