Skip to content

Commit

Permalink
Fix encoding for files created for building package (issue python-poe…
Browse files Browse the repository at this point in the history
…try#1027)

This is minimal set of modifications, which fixed the problem.

There are still more places, where files are open in text mode
without explicit encoding, thus possibly failing on systems not using
UTF-8 console encoding.
  • Loading branch information
vlcinsky committed May 7, 2019
1 parent cb64914 commit 0490027
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions poetry/masonry/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
dist_info.mkdir()

if "scripts" in poetry.local_config or "plugins" in poetry.local_config:
with (dist_info / "entry_points.txt").open("w") as f:
with (dist_info / "entry_points.txt").open("w", encoding="utf-8") as f:
builder._write_entry_points(f)

with (dist_info / "WHEEL").open("w") as f:
with (dist_info / "WHEEL").open("w", encoding="utf-8") as f:
builder._write_wheel_file(f)

with (dist_info / "METADATA").open("w") as f:
with (dist_info / "METADATA").open("w", encoding="utf-8") as f:
builder._write_metadata_file(f)

return dist_info.name
Expand Down

0 comments on commit 0490027

Please sign in to comment.