mirror of
https://github.com/python/cpython.git
synced 2026-02-13 19:04:37 +00:00
[3.10] gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918). (GH-91946)
(cherry picked from commit 36306cf786)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
3e219d3123
commit
dbe666d398
1 changed files with 1 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ def make_nrc(self, test_data):
|
|||
if sys.platform != 'cygwin':
|
||||
mode += 't'
|
||||
temp_fd, temp_filename = tempfile.mkstemp()
|
||||
with os.fdopen(temp_fd, mode=mode) as fp:
|
||||
with os.fdopen(temp_fd, mode=mode, encoding="utf-8") as fp:
|
||||
fp.write(test_data)
|
||||
self.addCleanup(os.unlink, temp_filename)
|
||||
return netrc.netrc(temp_filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue