From: Serhiy Storchaka Date: Tue, 26 Apr 2022 04:58:41 +0000 (+0300) Subject: gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918) X-Git-Tag: v3.11.0b1~214 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36306cf7862097318a3fef74224075cc4cf37229;p=thirdparty%2FPython%2Fcpython.git gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918) --- diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py index a6b4bc47a32c..3cca1e8ff1ac 100644 --- a/Lib/test/test_netrc.py +++ b/Lib/test/test_netrc.py @@ -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)