Skip to content

Commit

Permalink
Specify encoding in test_install. Ref #232.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 2, 2024
1 parent 1e3fe05 commit acff48d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions distutils/tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,9 @@ def test_record(self):
cmd.ensure_finalized()
cmd.run()

f = open(cmd.record)
try:
content = f.read()
finally:
f.close()
content = pathlib.Path(cmd.record).read_text(encoding='utf-8')

found = [os.path.basename(line) for line in content.splitlines()]
found = [pathlib.Path(line).name for line in content.splitlines()]
expected = [
'hello.py',
'hello.%s.pyc' % sys.implementation.cache_tag,
Expand Down Expand Up @@ -234,9 +230,9 @@ def test_record_extensions(self):
cmd.ensure_finalized()
cmd.run()

content = pathlib.Path(cmd.record).read_text()
content = pathlib.Path(cmd.record).read_text(encoding='utf-8')

found = [os.path.basename(line) for line in content.splitlines()]
found = [pathlib.Path(line).name for line in content.splitlines()]
expected = [
_make_ext_name('xx'),
'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2],
Expand Down

0 comments on commit acff48d

Please sign in to comment.