Skip to content

Commit 3a0cf93

Browse files
authored
bpo-32248: Fix test_importlib.test_open() (#5213)
Use the binary.file instead of utf-8.file to avoid issues with Unix newlines vs Windows newlines.
1 parent 44a70e9 commit 3a0cf93

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_importlib/test_open.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def execute(self, package, path):
1919

2020
class OpenTests:
2121
def test_open_binary(self):
22-
with resources.open_binary(self.data, 'utf-8.file') as fp:
22+
with resources.open_binary(self.data, 'binary.file') as fp:
2323
result = fp.read()
24-
self.assertEqual(result, b'Hello, UTF-8 world!\n')
24+
self.assertEqual(result, b'\x00\x01\x02\x03')
2525

2626
def test_open_text_default_encoding(self):
2727
with resources.open_text(self.data, 'utf-8.file') as fp:

0 commit comments

Comments
 (0)