-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
Turn EncodingWarning into errors and cleanup pytest.ini #4255
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
Turn EncodingWarning into errors and cleanup pytest.ini #4255
Conversation
| 6 |
29766ec to bb9e67c Compare EncodingWarning spam in testspytest.ini for EncodingWarning from external libraries 2acaf1e to 63dda17 Compare 5462b63 to 888a1f0 Compare | @abravalheri Looks like there's still at least one EncodingWarning left to be able to fully re-enable them as errors. |
| Yeah, a bit of a shame... It might be the case there is a Worst case scenario, I was wondering if there is a way of introducing a |
| Up to you, looks like the last ignore line I added works. Although it could hide other issues in that module. I also didn't originally add a news fragment for this PR, but now that we're preventing more EncodingWarning from reaching user code, that's a beneficial user-facing change that's worth mentioning. |
c40ddc6 to 98523ac Compare | I think I understood the root of the problem: |
| Now, that problem with This part is really weird: Why the |
24066c6 to c144690 Compare pytest.ini for EncodingWarning from external librariesEncodingWarning into errors and cleanup pytest.ini | @Avasam, this is the change for the windows errors: --- setuptools/tests/test_windows_wrappers.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setuptools/tests/test_windows_wrappers.py b/setuptools/tests/test_windows_wrappers.py index 3f321386f..b27268935 100644 --- a/setuptools/tests/test_windows_wrappers.py +++ b/setuptools/tests/test_windows_wrappers.py @@ -110,7 +110,11 @@ class TestCLI(WrapperTester): 'arg5 a\\\\b', ] proc = subprocess.Popen( - cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, text=True + cmd, + stdout=subprocess.PIPE, + stdin=subprocess.PIPE, + text=True, + encoding="utf-8", ) stdout, stderr = proc.communicate('hello\nworld\n') actual = stdout.replace('\r\n', '\n') @@ -143,7 +147,11 @@ class TestCLI(WrapperTester): 'arg5 a\\\\b', ] proc = subprocess.Popen( - cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, text=True + cmd, + stdout=subprocess.PIPE, + stdin=subprocess.PIPE, + text=True, + encoding="utf-8", ) stdout, stderr = proc.communicate('hello\nworld\n') actual = stdout.replace('\r\n', '\n') @@ -191,6 +199,7 @@ class TestCLI(WrapperTester): stdin=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, + encoding="utf-8", ) stdout, stderr = proc.communicate() actual = stdout.replace('\r\n', '\n') @@ -240,6 +249,7 @@ class TestGUI(WrapperTester): stdin=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, + encoding="utf-8", ) stdout, stderr = proc.communicate() assert not stdout -- 2.43.2 |
3b9d231 to cfeea70 Compare + avoid getpreferredencoding when possible
Vendored distutils was updated with fixes
cfeea70 to 22ca7e5 Compare 


Summary of changes
Attempt at supeerseding #4234 (comment) w/o any potential breaking change
Essentially a band-aid for #3810 to make reading failed tests results more bearable.
Pull Request Checklist
newsfragments/.(See documentation for details)