Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate camelCase aliases from threading.py #87889

Closed
JelleZijlstra opened this issue Apr 4, 2021 · 16 comments
Closed

Deprecate camelCase aliases from threading.py #87889

JelleZijlstra opened this issue Apr 4, 2021 · 16 comments
Assignees
Labels
3.10 only security fixes stdlib Python modules in the Lib dir

Comments

@JelleZijlstra
Copy link
Member

BPO 43723
Nosy @rhettinger, @terryjreedy, @pitrou, @vstinner, @tiran, @JelleZijlstra, @miss-islington, @tirkarthi
PRs
  • bpo-43723: deprecate camelCase aliases from threading #25174
  • bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361) #25361
  • [3.9] bpo-43723: Backport IDLE doc change (GH-25174) #25432
  • [3.8] [3.9] bpo-43723: Revert IDLE doc change (GH-25174) #25433
  • [3.8] bpo-43723: Backport IDLE doc change (GH-25174) #25435
  • 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 = 'https://github.com/JelleZijlstra'
    closed_at = <Date 2021-04-12.12:07:13.169>
    created_at = <Date 2021-04-04.01:01:50.964>
    labels = ['library', '3.10']
    title = 'Deprecate camelCase aliases from threading.py'
    updated_at = <Date 2021-04-16.09:50:58.623>
    user = 'https://github.com/JelleZijlstra'

    bugs.python.org fields:

    activity = <Date 2021-04-16.09:50:58.623>
    actor = 'vstinner'
    assignee = 'JelleZijlstra'
    closed = True
    closed_date = <Date 2021-04-12.12:07:13.169>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2021-04-04.01:01:50.964>
    creator = 'JelleZijlstra'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43723
    keywords = ['patch']
    message_count = 16.0
    messages = ['390165', '390166', '390337', '390442', '390826', '390833', '390837', '390840', '390843', '390845', '390846', '390847', '391167', '391169', '391179', '391180']
    nosy_count = 8.0
    nosy_names = ['rhettinger', 'terry.reedy', 'pitrou', 'vstinner', 'christian.heimes', 'JelleZijlstra', 'miss-islington', 'xtreak']
    pr_nums = ['25174', '25361', '25432', '25433', '25435']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43723'
    versions = ['Python 3.10']

    @JelleZijlstra
    Copy link
    Member Author

    Followup from bpo-37804: deprecate the remaining camelCase aliases, such as threading.currentThread. PR coming soon.

    @JelleZijlstra JelleZijlstra added the 3.10 only security fixes label Apr 4, 2021
    @JelleZijlstra JelleZijlstra self-assigned this Apr 4, 2021
    @JelleZijlstra JelleZijlstra added stdlib Python modules in the Lib dir 3.10 only security fixes labels Apr 4, 2021
    @JelleZijlstra JelleZijlstra self-assigned this Apr 4, 2021
    @JelleZijlstra JelleZijlstra added the stdlib Python modules in the Lib dir label Apr 4, 2021
    @rhettinger
    Copy link
    Contributor

    I don't think there is any advantage in doing this. It will just break code that has worked for a very long time.

    This is the reason that the logging module wasn't changed to more modern naming conventions.

    @vstinner
    Copy link
    Member

    vstinner commented Apr 6, 2021

    Raymond Hettinger:

    I don't think there is any advantage in doing this. It will just break code that has worked for a very long time.

    Do you mean code written for Python 2? Right, it's unfortunate that it became harder to write a single code base working on Python 2 and Python 2. But Python 2 had officially reached end of life in January 2020, and Python 3.0 changed threading method names 13 years ago (2008).

    Deprecating and removing aliases are two different things. IMO deprecating is non-controversial, especially because DeprecationWarning is hidden by default.

    Removing requires to estimate how many projects are impacted. On the top 4000 PyPI projects, I count 80 projects which still call currentThread() for example: that's significant. Example of projects: Twisted, pyuwsgi, PyQt5_sip, mod_wsgi, mercurial, lockfile, jupyterlab, gevent, etc. I didn't check if these projects call current_thread() on Python 3.

    I would suggest to wait until the most popular PyPI projects no longer call deprecated methods before removing them.

    I suggest to restrict the PR to deprecatation, and not plan removal yet.

    @tirkarthi
    Copy link
    Member

    Just to add the last time isAlive was removed in favor of is_alive it was significant change enough that several libraries in Fedora packaging Python libraries and other open source code. The GitHub PR shows several projects that were affected and I linked to this PR while filing the fixes to relevant libraries.

    #15225

    There are still new reports of the isAlive change when people try to upgrade : https://github.com/search?l=Python&o=desc&q=isalive+is%3Aissue&s=updated&state=open&type=Issues

    I would request to really weigh in the cost of doing this since at one point this will cause more burden when the aliases have to be removed in future hindering Python upgrades and the change just seems to unify the casing of the method names without helping the user here.

    @vstinner
    Copy link
    Member

    New changeset 9825bdf by Jelle Zijlstra in branch 'master':
    bpo-43723: Deprecate camelCase aliases from threading (GH-25174)
    9825bdf

    @tiran
    Copy link
    Member

    tiran commented Apr 12, 2021

    The commit broke my PR #25329. You missed a call in asyncio tests.

    @tiran
    Copy link
    Member

    tiran commented Apr 12, 2021

    New changeset 95bbb33 by Christian Heimes in branch 'master':
    bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361)
    95bbb33

    @vstinner
    Copy link
    Member

    Thanks Jelle Zijlstra, I merged your PR! I close issue.

    Ok, aliases are now deprecated. If someone wants to actually remove the aliases, I suggest to help all projects still using them to fix their deprecation warnings:
    https://bugs.python.org/issue43723#msg390337

    For now, I prefer to not schedule the removal. There are too many projects using it. By the way, I'm surprised that this number, I expected that most projects switched since Python 2.6 :-)

    Christian:

    The commit broke my PR #25329

    Usually, warnings are not treated as errors. Thanks for fixing test_asyncio!

    @tiran
    Copy link
    Member

    tiran commented Apr 12, 2021

    Usually, warnings are not treated as errors. Thanks for fixing test_asyncio!

    Tests should treat any unhandled deprecation warnings as a test failure.

    @tirkarthi
    Copy link
    Member

    I opened a thread a year back on running tests with -Werror in CI. This issue still pops up when someone runs with -Wall and finds unhandled deprecation warnings.

    https://discuss.python.org/t/run-test-suite-with-werror-on-ci/2333

    @vstinner
    Copy link
    Member

    Tests should treat any unhandled deprecation warnings as a test failure.

    libregrtest sets a sys.unraisablehook: a test is marked as "failed" if any "unraisable exception" is logged.

    libregrtest might use a hook on warnings to do the same: log the warning, but mark the test as failed?

    One issue that I had with libregrtest and sys.unraisablehook was that some "unraisable exception" was not logged in buildbot logs. I had to use sys.__stderr__ to ensure that the exception is logged. See regrtest_unraisable_hook() of test.libregrtest.utils.

    It would be annoying to get a test marked as "FAILED" if the warning is not visible in logs :-(

    ---

    Using -Werror on some CIs would be another option.

    @vstinner
    Copy link
    Member

    Oh by the way, if someone wants to enhance libregrtest / our CI, please open a new issue ;-) I'm not interested so, I didn't open a new issue :-) Someone also once proposed to add a post-commit buildbot using -Werror. It may be enough.

    @terryjreedy
    Copy link
    Member

    New changeset 56c76df by Terry Jan Reedy in branch '3.9':
    [3.9] bpo-43723: Revert IDLE doc change (GH-25174)
    56c76df

    @terryjreedy
    Copy link
    Member

    New changeset b405647 by Terry Jan Reedy in branch '3.8':
    [3.8] bpo-43723: Backport IDLE doc change (GH-25174)
    b405647

    @miss-islington
    Copy link
    Contributor

    New changeset 582917f by Miss Islington (bot) in branch '3.8':
    [3.9] bpo-43723: Revert IDLE doc change (GH-25174)
    582917f

    @vstinner
    Copy link
    Member

    New changeset 582917f by Miss Islington (bot) in branch '3.8':
    [3.9] bpo-43723: Revert IDLE doc change (GH-25174)

    Oh. I didn't notice that b405647 was already merged.

    After being rebased before the merge, 582917f became an empty change!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    sampsyo added a commit to beetbox/beets that referenced this issue Aug 21, 2022
    `notifyAll` was deprecated in:
    python/cpython#87889
    
    The new name, `notify_all`, has been available since Python 3.0.
    arsaboo added a commit to arsaboo/beets that referenced this issue Aug 26, 2022
    commit e584b04
    Merge: 7467bc3 2ebc28d
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 10:44:31 2022 -0700
    
        Merge pull request beetbox#4199 from jcassette/duplicate
    
        Allow to configure which fields are used to find duplicates
    
    commit 2ebc28d
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 10:36:40 2022 -0700
    
        Improve changelog for beetbox#4199
    
    commit 1054b72
    Merge: 3c945cb 6e0f7a1
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 10:34:15 2022 -0700
    
        Merge branch 'master' into duplicate
    
    commit 3c945cb
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 10:31:45 2022 -0700
    
        Change config key from "single" to "item"
    
        For consistency with the rest of the terminology in the docs/config.
        Also, correct the documentation (which previously only covered albums).
    
    commit bcc8903
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 10:27:31 2022 -0700
    
        Refactor query utilities
    
        We now use somewhat more general query constructors in `dbcore`,
        avoiding the need for somewhat special-purpose `duplicates` methods on
        the model objects.
    
    commit ca38486
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 10:12:47 2022 -0700
    
        Clarify some control flow
    
    commit 7467bc3
    Merge: 6e0f7a1 8cb3143
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 10:01:37 2022 -0700
    
        Merge pull request beetbox#4450 from beetbox/deprecations
    
        Resolve some deprecation warnings
    
    commit 8cb3143
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 09:50:53 2022 -0700
    
        Avoid BeautifulSoup deprecation warning
    
        The `text` parameter to `SoupStrainer` was renamed to `string` in 2015
        (4.4.0) and started producing a warning this year (4.11.0).
        https://bazaar.launchpad.net/%7Eleonardr/beautifulsoup/bs4/view/head:/CHANGELOG
    
    commit 8c84bae
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 08:18:49 2022 -0700
    
        Remove `match_querystring` in `responses`
    
        Quoth the responses documentation:
    
        > querystring is matched by default
    
        Not sure how recent this is, unfortunately---but probably 0.17.0, since
        that's the version where `match_querystring` was deprecated.
    
    commit 63b7595
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 08:13:07 2022 -0700
    
        Remove use of `imp`
    
        The replacements in `importlib.util` have been available since Python
        3.5.
    
    commit 2c9f699
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 08:06:10 2022 -0700
    
        Use non-deprecated name for `notify_all`
    
        `notifyAll` was deprecated in:
        python/cpython#87889
    
        The new name, `notify_all`, has been available since Python 3.0.
    
    commit 6e0f7a1
    Merge: f0a6bbb bf8fbed
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 07:09:12 2022 -0700
    
        Merge pull request beetbox#4412 from beetbox/album-items
    
        Document Album.items() / LibModel.items() conflict
    
    commit f0a6bbb
    Merge: 40d7fa6 fafddce
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sun Aug 21 07:07:23 2022 -0700
    
        Merge pull request beetbox#4447 from wisp3rwind/pr_version_regex
    
        release.py: fix version regex (remove u'' string prefix)
    
    commit bf8fbed
    Author: Callum Brown <callum@calcuode.com>
    Date:   Sun Aug 21 14:34:18 2022 +0100
    
        Clarify Album.items() conflict
    
    commit 40d7fa6
    Merge: 4761c35 fb9e95b
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sat Aug 20 17:14:02 2022 -0700
    
        Merge pull request beetbox#4095 from Duncaen/formatted-modify
    
        Formatted modify and import --set-field.
    
    commit fb9e95b
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sat Aug 20 16:50:20 2022 -0700
    
        Fix some long lines
    
    commit b207224
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sat Aug 20 16:47:01 2022 -0700
    
        Further document formatted modify with examples
    
        I think these can make it clearer why someone would want to use this
        feature. (Part of beetbox#4095.)
    
    commit dad918e
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sat Aug 20 16:43:55 2022 -0700
    
        Out-of-date changelog fixes
    
    commit 7af40db
    Merge: 0456c8f 4761c35
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Sat Aug 20 16:37:52 2022 -0700
    
        Merge branch 'master' into formatted-modify
    
    commit 4761c35
    Merge: 18ab441 b7ff616
    Author: Benedikt <wisp3rwind@posteo.eu>
    Date:   Sat Aug 20 07:33:23 2022 +0200
    
        Merge pull request beetbox#4395 from clach04/patch-1
    
        Version bump to 1.6.1
    
    commit fafddce
    Author: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com>
    Date:   Sat Aug 20 07:30:15 2022 +0200
    
        release.py: fix version regex (remove u'' string prefix)
    
    commit 18ab441
    Merge: 0ae7d66 93725c4
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Fri Aug 19 17:54:52 2022 -0700
    
        Merge pull request beetbox#4444 from BinaryBrain/master
    
        Add Beetstream in the plugin list
    
    commit 93725c4
    Author: Sacha Bron <me@sachabron.ch>
    Date:   Sat Aug 20 01:30:38 2022 +0200
    
        Add Beetstream in the plugin list
    
    commit 0ae7d66
    Merge: e995019 32ce44f
    Author: Benedikt <wisp3rwind@posteo.eu>
    Date:   Thu Aug 18 18:11:03 2022 +0200
    
        Merge pull request beetbox#4441 from beetbox/exact-prefix
    
        Change the prefix for exact match queries
    
    commit 32ce44f
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Wed Aug 17 16:25:17 2022 -0700
    
        One more test fix
    
    commit 495c8ac
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Wed Aug 17 16:11:16 2022 -0700
    
        Update exact query prefix tests
    
    commit f71e503
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Wed Aug 17 16:05:33 2022 -0700
    
        Change the prefix for exact match queries
    
        PR beetbox#4251 added exact match queries, which are great, but it was
        subsequently pointed out that the `~` query prefix was already in use:
        beetbox#4251 (comment)
    
        So this changes the prefix from `~` to `=~`. A little longer, but
        hopefully it makes the relationship to the similarly-new `=` prefix obvious.
    
    commit e995019
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Wed Aug 17 15:55:25 2022 -0700
    
        Doc tweaks for beetbox#4438
    
    commit fa81d6c
    Merge: 6eec17c 6aa9804
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Wed Aug 17 15:54:43 2022 -0700
    
        Merge pull request beetbox#4438 from jaimeMF/singleton_unique_paths
    
        Add path template "sunique" to disambiguate between singleton tracks
    
    commit 6aa9804
    Author: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
    Date:   Wed Aug 17 17:03:16 2022 +0200
    
        Document the %sunique template
    
    commit f641df0
    Author: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
    Date:   Tue Aug 16 17:54:12 2022 +0200
    
        Encapsulate common code for the aunique and sunique templates in a single method
    
    commit 8d957f3
    Author: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
    Date:   Fri Aug 12 14:19:52 2022 +0200
    
        Add path template "sunique" to disambiguate between singleton tracks
    
    commit 6eec17c
    Merge: 1dddcb8 6803ef3
    Author: Adrian Sampson <adrian@radbox.org>
    Date:   Fri Aug 5 09:15:00 2022 -0400
    
        Merge pull request beetbox#4433 from vicholp/master
    
        Fix get item file in web plugin
    
    commit 6803ef3
    Author: vicholp <vlinerospardo@gmail.com>
    Date:   Wed Aug 3 01:22:45 2022 -0400
    
        add test to get item file of web plugin
    
    commit fde2ad3
    Author: vicholp <vlinerospardo@gmail.com>
    Date:   Wed Aug 3 01:22:35 2022 -0400
    
        fix get item file of web plugin
    
    commit 1cde938
    Author: Callum Brown <callum@calcuode.com>
    Date:   Tue Jul 12 11:21:52 2022 +0100
    
        Document Album.items() / LibModel.items() conflict
    
        Closes: beetbox#4404
    
    commit b7ff616
    Author: clach04 <clach04@gmail.com>
    Date:   Fri Jul 1 17:51:54 2022 -0700
    
        Version bump to 1.6.1
    
        Matche setup.py (package) version
    
    commit bf9bf48
    Merge: bcf2e15 10338c2
    Author: Julien Cassette <jcassette@users.noreply.github.com>
    Date:   Sun Jan 30 16:47:44 2022 +0100
    
        Merge branch 'master' into duplicate
    
        # Conflicts:
        #	docs/changelog.rst
    
    commit bcf2e15
    Author: Julien Cassette <jcassette@users.noreply.github.com>
    Date:   Sun Jan 30 16:38:34 2022 +0100
    
        Move construct_match_queries() to dbcore.Model
    
    commit 7633465
    Author: Julien Cassette <jcassette@users.noreply.github.com>
    Date:   Sat Jan 22 22:36:47 2022 +0100
    
        Add duplicate_keys feature for singletons
    
    commit f50d250
    Author: Julien Cassette <jcassette@users.noreply.github.com>
    Date:   Sun Jan 2 17:25:30 2022 +0100
    
        Review duplicate_keys feature
    
    commit 6ce29a6
    Author: Julien Cassette <jcassette@users.noreply.github.com>
    Date:   Sat Nov 27 14:36:59 2021 +0100
    
        Allow to use flexible attributes in duplicate_keys
    
    commit 3fdfaaa
    Author: Julien Cassette <jcassette@users.noreply.github.com>
    Date:   Sun Nov 21 18:41:06 2021 +0100
    
        Allow to configure which fields are used to find duplicates
    
    commit 0456c8f
    Author: Duncan Overbruck <mail@duncano.de>
    Date:   Wed Dec 15 14:32:11 2021 +0100
    
        test multiple items in test_modify_formatted
    
    commit 795bc2e
    Author: Duncan Overbruck <mail@duncano.de>
    Date:   Wed Dec 15 14:31:15 2021 +0100
    
        compile modify templates only once
    
    commit a2030d1
    Author: Duncan Overbruck <mail@duncano.de>
    Date:   Wed Oct 6 15:52:08 2021 +0200
    
        changelog: import/modify field formatting
    
    commit 5824d46
    Author: Duncan Overbruck <mail@duncano.de>
    Date:   Wed Oct 6 15:44:12 2021 +0200
    
        changelog: rewrite permissions cover art change
    
    commit 819ba73
    Author: Duncan Overbruck <mail@duncano.de>
    Date:   Wed Oct 6 15:40:03 2021 +0200
    
        allow templates/formatting of set_fields on import
    
    commit 636e36e
    Author: Duncan Overbruck <mail@duncano.de>
    Date:   Wed Oct 6 15:14:34 2021 +0200
    
        allow templates/formatting when setting fields with modify
    JOJ0 pushed a commit to JOJ0/beets that referenced this issue Oct 30, 2022
    `notifyAll` was deprecated in:
    python/cpython#87889
    
    The new name, `notify_all`, has been available since Python 3.0.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    7 participants