◐ Shell
clean mode source ↗

bpo-43651: Fix EncodingWarning in test_warnings by methane · Pull Request #25126 · python/cpython

Expand Up @@ -935,10 +935,10 @@ class PyWarningsDisplayTests(WarningsDisplayTests, unittest.TestCase): def test_tracemalloc(self): self.addCleanup(os_helper.unlink, os_helper.TESTFN)
with open(os_helper.TESTFN, 'w') as fp: with open(os_helper.TESTFN, 'w', encoding="utf-8") as fp: fp.write(textwrap.dedent(""" def func(): f = open(__file__) f = open(__file__, "rb") # Emit ResourceWarning f = None
Expand Down Expand Up @@ -973,7 +973,7 @@ def run(*args): File "{filename}", lineno 7 func() File "{filename}", lineno 3 f = open(__file__) f = open(__file__, "rb") ''').strip() self.assertEqual(stderr, expected)
Expand Down