https://github.com/python/cpython/commit/abb3b3142b2ac25e034a1d52fcb08f8b71b1e023
commit: abb3b3142b2ac25e034a1d52fcb08f8b71b1e023
branch: 3.14
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2025-10-20T20:05:42+03:00
summary:

[3.14] gh-63161: Fix test_source_encoding when stderr is StringIO (GH-140361)

files:
M Lib/test/test_source_encoding.py

diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py
index a285fc2ceef24e..36c8d87182dcf9 100644
--- a/Lib/test/test_source_encoding.py
+++ b/Lib/test/test_source_encoding.py
@@ -521,7 +521,7 @@ def check_script_error(self, src, expected, lineno=...):
             line = src.splitlines()[lineno-1].decode(errors='replace')
             if lineno == 1:
                 line = line.removeprefix('\ufeff')
-            line = line.encode(sys.stderr.encoding, sys.stderr.errors)
+            line = line.encode(sys.__stderr__.encoding, sys.__stderr__.errors)
             self.assertIn(line, err)
 
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to