gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918)

This commit is contained in:
Serhiy Storchaka 2022-04-26 07:58:41 +03:00 committed by GitHub
parent 5397b5afc1
commit 36306cf786
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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)