8000 bpo-43651: Fix EncodingWarning in test_file and test_file_eintr (GH-2… · python/cpython@55f31be · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 55f31be

Browse files
authored
bpo-43651: Fix EncodingWarning in test_file and test_file_eintr (GH-25109)
1 parent ad493ed commit 55f31be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/test_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def testReadinto_text(self):
5252
# verify readinto refuses text files
5353
a = array('b', b'x'*10)
5454
self.f.close()
55-
self.f = self.open(TESTFN, 'r')
55+
self.f = self.open(TESTFN, encoding="utf-8")
5656
if hasattr(self.f, "readinto"):
5757
self.assertRaises(TypeError, self.f.readinto, a)
5858

Lib/test/test_file_eintr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class TestTextIOSignalInterrupt(TestFileIOSignalInterrupt):
213213
def _generate_infile_setup_code(self):
214214
"""Returns the infile = ... line of code to make a TextIOWrapper."""
215215
return ('import %s as io ;'
216-
'infile = io.open(sys.stdin.fileno(), "rt", newline=None) ;'
216+
'infile = io.open(sys.stdin.fileno(), encoding="utf-8", newline=None) ;'
217217
'assert isinstance(infile, io.TextIOWrapper)' %
218218
self.modname)
219219

0 commit comments

Comments
 (0)
0