-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-105376: Restore deprecated logging warn() method #122775
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
Conversation
We have some new pages for deprecations, see: These RSTs are Please could you list these deprecations in one of those files? I guess we're not setting a version in which to remove? In which case, "Pending Removal in Future Versions": |
I do wonder if we should be more explicit in documentation, or improve the warning some other way? This is a very long-standing deprecation warning, so clearly users are not seeing it. A crude search (using [^es] to exclude A |
There's a lot of false positives in there. A narrower search in the top 8k PyPI projects: Found 136 matching lines in 53 projects❯ python3 ~/github/misc/cpython/search_pypi_top.py -q . "logging\.warn\b"
./anyconfig-0.14.0.tar.gz: anyconfig-0.14.0/NEWS: - change: replace logging.warn with warnings.warn, and remove other logging code
./behave-1.2.6.tar.gz: behave-1.2.6/tests/issues/test_issue0495.py: logging.warn(message)
./dirac-8.0.49.tar.gz: dirac-8.0.49/release.notes: FIX: (#4956) use logging.warning in favor of deprecated logging.warn
./distrax-0.1.5.tar.gz: distrax-0.1.5/distrax/_src/utils/transformations.py: logging.warn("[Distrax]: the '%s' primitive can exhibit unstable "
./apache-superset-4.0.1.tar.gz: apache-superset-4.0.1/superset/migrations/versions/2019-11-06_15-23_78ee127d0d1d_reconvert_legacy_filters_into_adhoc.py: logging.warn(ex)
./draftjs_exporter-5.0.0.tar.gz: draftjs_exporter-5.0.0/PKG-INFO: logging.warn(f'Missing config for "{type_}". Discarding block, keeping content.')
./draftjs_exporter-5.0.0.tar.gz: draftjs_exporter-5.0.0/PKG-INFO: logging.warn(f'Missing config for "{type_}". Using div instead.')
./draftjs_exporter-5.0.0.tar.gz: draftjs_exporter-5.0.0/README.md: logging.warn(f'Missing config for "{type_}". Discarding block, keeping content.')
./draftjs_exporter-5.0.0.tar.gz: draftjs_exporter-5.0.0/README.md: logging.warn(f'Missing config for "{type_}". Using div instead.')
./draftjs_exporter-5.0.0.tar.gz: draftjs_exporter-5.0.0/draftjs_exporter.egg-info That's something like 0.6% of projects. A few of these are also changelogs ("replace logging.warn with warnings.warn"), there's also the pylint and Ruff linters in there. |
Right, there is no planned removal. I mentioned the deprecated function in "Pending Removal in Future Versions". |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…22775) This reverts commit dcc028d and commit 6c54e5d. Keep the deprecated logging warn() method in Python 3.13. (cherry picked from commit d323997) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
GH-122856 is a backport of this pull request to the 3.13 branch. |
Merged, thanks.
Please review also the 3.13 backport. |
#122856) gh-105376: Restore deprecated logging warn() method (GH-122775) This reverts commit dcc028d and commit 6c54e5d. Keep the deprecated logging warn() method in Python 3.13. (cherry picked from commit d323997) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This reverts commit dcc028d and commit 6c54e5d.
Keep the deprecated logging warn() method in Python 3.13.
📚 Documentation preview 📚: https://cpython-previews--122775.org.readthedocs.build/