]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-63161: Fix test_source_encoding when stderr is StringIO (GH-140361)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 20 Oct 2025 17:05:42 +0000 (20:05 +0300)
committerGitHub <noreply@github.com>
Mon, 20 Oct 2025 17:05:42 +0000 (20:05 +0300)
Lib/test/test_source_encoding.py

index a285fc2ceef24efba71607560e6a84010377c372..36c8d87182dcf9dc62cd4691366551afbbd0e3b0 100644 (file)
@@ -521,7 +521,7 @@ class FileSourceEncodingTest(AbstractSourceEncodingTest, unittest.TestCase):
             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)