Skip to content

Commit

Permalink
Fixed build_files encoding problem
Browse files Browse the repository at this point in the history
  • Loading branch information
aluttik committed Aug 29, 2018
1 parent 9ca4bf3 commit 9611131
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crossplane/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def build_files(payload, dirname=None, indent=4, tabs=False, header=False):
parsed = config['parsed']
output = build(parsed, indent=indent, tabs=tabs, header=header)
output = output.rstrip() + '\n'
with codecs.open(path, 'w') as fp:
with codecs.open(path, 'w', encoding='utf-8') as fp:
fp.write(output)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_build_files_with_unicode(tmpdir):
{
"directive": "user",
"line": 1,
"args": ["測試"],
"args": [u"測試"],
}
]
}
Expand Down

0 comments on commit 9611131

Please sign in to comment.