bpo-43510: Implement PEP 597 opt-in EncodingWarning.#19481
Conversation
c37295e to
6f72b38
Compare
April 13, 2020 09:22
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
January 29, 2021 08:37
db537b9 to
c5c556c
Compare
January 30, 2021 08:52
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. |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 RHEL7 LTO + PGO 3.x has failed when building commit 4827483. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/96/builds/910 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 412 tests OK. 10 slowest tests:
1 test failed: 14 tests skipped: 2 re-run tests: Total duration: 6 min 19 sec Click to see traceback logsTraceback (most recent call last):
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/test_ftplib.py", line 623, in test_storlines
self.check_data(self.server.handler_instance.last_received_data, RETR_DATA)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/test_ftplib.py", line 494, in check_data
self.assertEqual(len(received), len(expected))
AssertionError: 12019 != 12018
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/test_tools/test_reindent.py", line 29, in test_reindent_file_with_bad_encoding
rc, out, err = assert_python_ok(self.script, '-r', bad_coding_path)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/support/script_helper.py", line 160, in assert_python_ok
return _assert_python(True, *args, **env_vars)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/support/script_helper.py", line 145, in _assert_python
res.fail(cmd_line)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/support/script_helper.py", line 72, in fail
raise AssertionError("Process return code is %d\n"
AssertionError: Process return code is 1
command line: ['/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/python', '-X', 'faulthandler', '-I', '/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Tools/scripts/reindent.py', '-r', '/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/bad_coding.py']
|
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 RHEL7 LTO 3.x has failed when building commit 4827483. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/507/builds/896 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 412 tests OK. 10 slowest tests:
1 test failed: 14 tests skipped: 1 re-run test: Total duration: 7 min 15 sec Click to see traceback logsTraceback (most recent call last):
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/test_tools/test_reindent.py", line 29, in test_reindent_file_with_bad_encoding
rc, out, err = assert_python_ok(self.script, '-r', bad_coding_path)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/support/script_helper.py", line 160, in assert_python_ok
return _assert_python(True, *args, **env_vars)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/support/script_helper.py", line 145, in _assert_python
res.fail(cmd_line)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/support/script_helper.py", line 72, in fail
raise AssertionError("Process return code is %d\n"
AssertionError: Process return code is 1
command line: ['/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/python', '-X', 'faulthandler', '-I', '/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Tools/scripts/reindent.py', '-r', '/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/bad_coding.py']
|
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 Windows10 3.x has failed when building commit 4827483. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/146/builds/1014 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 395 tests OK. 10 slowest tests:
1 test failed: 31 tests skipped: 1 re-run test: Total duration: 19 min 35 sec Click to see traceback logsTraceback (most recent call last):
File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_locale.py", line 567, in test_getsetlocale_issue1813
locale.setlocale(locale.LC_CTYPE, loc)
File "D:\buildarea\3.x.bolen-windows10\build\lib\locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
|
Sorry, something went wrong.
|
test_locale fail is unrelating to this PR. See bpo-37945. |
Sorry, something went wrong.
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_encodingandPYTHONWARNDEFAULTENCODING.bpo-43510