-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
bpo-43510: Implement PEP 597 opt-in EncodingWarning. #19481
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
c37295e
to
6f72b38
Compare
The warning is raised only in dev mode. pathlib uses the new `io.text_encoding` helper function. Other libraries will follow.
e44dc5b
to
939f4a0
Compare
db537b9
to
c5c556c
Compare
sys.flags.encoding_warning -> warn_default_encoding -X warn_encoding -> warn_default_encoding PYTHONWARNENCODING -> PYTHONWARNDEFAULTENCODING
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Thanks @methane ! I've replied to your comments with updated suggestions to reflect your feedback. |
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
I will merge this PR next week if there are no objections. |
|
|
|
test_locale fail is unrelating to this PR. See bpo-37945. |
Thanks @methane ! Excited to see this in Python 3.10. |
We have a vendored version of ConcurrentLogHandler 0.9.1 [1] from omero-py that we use. This version is from 2013, has a few bugs, and doesn't work properly with the encoding changes [2,3] made in Python 3.10. A new version [4] whose lineage is that of the now unmaintained ConcurrentLogHandler is now available which resolves several of the aforementioned bugs, supports Python 3.10, and is drop in replacement API compatible with the previous version. This commit adds a dependency for this new version and swaps the default logger class for it in configuration. 1. https://pypi.org/project/ConcurrentLogHandler/ 2. https://peps.python.org/pep-0597/ 3. python/cpython#19481 4. https://pypi.org/project/concurrent-log-handler/
See PEP 597.
-X warn_default_encoding
andPYTHONWARNDEFAULTENCODING
.bpo-43510