Skip to content

Commit 6f754c2

Browse files
methanejaraco
authored andcommitted
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181)
1 parent 5ca9bc7 commit 6f754c2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def build_files(file_defs, prefix=pathlib.Path()):
257257
with full_name.open('wb') as f:
258258
f.write(contents)
259259
else:
260-
with full_name.open('w') as f:
260+
with full_name.open('w', encoding='utf-8') as f:
261261
f.write(DALS(contents))
262262

263263

tests/test_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def pkg_with_dashes(site_dir):
8484
metadata_dir = site_dir / 'my_pkg.dist-info'
8585
metadata_dir.mkdir()
8686
metadata = metadata_dir / 'METADATA'
87-
with metadata.open('w') as strm:
87+
with metadata.open('w', encoding='utf-8') as strm:
8888
strm.write('Version: 1.0\n')
8989
return 'my-pkg'
9090

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

0 commit comments

Comments
 (0)