Skip to content

Commit

Permalink
Convert to utf-8 before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWilhelm committed Sep 11, 2019
1 parent 572e421 commit 0963222
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Version 4.0
Current versions
================

Version 3.2.2, 2019-07-11
-------------------------

- Write files as UTF-8, fixes ``codec can't encode characters`` error

Version 3.2.1, 2019-07-11
-------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/pyscaffold/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def create_file(path, content, pretend=False):
but operation is logged.
"""
if not pretend:
with open(path, 'w') as fh:
with open(path, 'w', encoding='utf-8') as fh:
fh.write(content)

logger.report('create', path)
Expand Down

0 comments on commit 0963222

Please sign in to comment.