summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2022-04-26 04:58:41 (GMT)
committerGitHub <noreply@github.com>2022-04-26 04:58:41 (GMT)
commit36306cf7862097318a3fef74224075cc4cf37229 (patch)
tree3d9756ccecd39261363e864fdd801c390ead9c99
parent5397b5afc1f594dc0ba3b7743351d595e637bf24 (diff)
downloadcpython-36306cf7862097318a3fef74224075cc4cf37229.zip
cpython-36306cf7862097318a3fef74224075cc4cf37229.tar.gz
cpython-36306cf7862097318a3fef74224075cc4cf37229.tar.bz2
gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918)
-rw-r--r--Lib/test/test_netrc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py
index a6b4bc4..3cca1e8 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)