Skip to content

Commit dbe666d

Browse files
[3.10] gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918). (GH-91946)
(cherry picked from commit 36306cf) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 3e219d3 commit dbe666d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_netrc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def make_nrc(self, test_data):
1111
if sys.platform != 'cygwin':
1212
mode += 't'
1313
temp_fd, temp_filename = tempfile.mkstemp()
14-
with os.fdopen(temp_fd, mode=mode) as fp:
14+
with os.fdopen(temp_fd, mode=mode, encoding="utf-8") as fp:
1515
fp.write(test_data)
1616
self.addCleanup(os.unlink, temp_filename)
1717
return netrc.netrc(temp_filename)

0 commit comments

Comments
 (0)