]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 26 Apr 2022 04:58:41 +0000 (07:58 +0300)
committerGitHub <noreply@github.com>
Tue, 26 Apr 2022 04:58:41 +0000 (07:58 +0300)
Lib/test/test_netrc.py

index a6b4bc47a32c1ac6bbd9fb36096de75e4c47ccf4..3cca1e8ff1ac1a71ee681120aa7ba3d4884b8192 100644 (file)
@@ -10,7 +10,7 @@ class NetrcTestCase(unittest.TestCase):
         mode = 'w'
         if sys.platform != 'cygwin':
             mode += 't'
-        with open(temp_filename, mode) as fp:
+        with open(temp_filename, mode, encoding="utf-8") as fp:
             fp.write(test_data)
         try:
             nrc = netrc.netrc(temp_filename)