Skip to content

Commit

Permalink
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored and jaraco committed Apr 7, 2021
1 parent 5ca9bc7 commit 6f754c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def build_files(file_defs, prefix=pathlib.Path()):
with full_name.open('wb') as f:
f.write(contents)
else:
with full_name.open('w') as f:
with full_name.open('w', encoding='utf-8') as f:
f.write(DALS(contents))


Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def pkg_with_dashes(site_dir):
metadata_dir = site_dir / 'my_pkg.dist-info'
metadata_dir.mkdir()
metadata = metadata_dir / 'METADATA'
with metadata.open('w') as strm:
with metadata.open('w', encoding='utf-8') as strm:
strm.write('Version: 1.0\n')
return 'my-pkg'

Expand All @@ -105,7 +105,7 @@ def pkg_with_mixed_case(site_dir):
metadata_dir = site_dir / 'CherryPy.dist-info'
metadata_dir.mkdir()
metadata = metadata_dir / 'METADATA'
with metadata.open('w') as strm:
with metadata.open('w', encoding='utf-8') as strm:
strm.write('Version: 1.0\n')
return 'CherryPy'

Expand Down

0 comments on commit 6f754c2

Please sign in to comment.