Skip to content

Commit

Permalink
use utf-8 encoding when reading/writing expanded templates
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <[email protected]>
  • Loading branch information
dirk-thomas committed Jul 18, 2019
1 parent 9ffe214 commit fc12331
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rosidl_cmake/rosidl_cmake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def expand_template(
if os.path.exists(output_file):
timestamp = os.path.getmtime(output_file)
if minimum_timestamp is None or timestamp > minimum_timestamp:
with open(output_file, 'r') as h:
with open(output_file, 'r', encoding='utf-8') as h:
if h.read() == content:
return
else:
Expand All @@ -170,7 +170,7 @@ def expand_template(
except FileExistsError:
pass

with open(output_file, 'w') as h:
with open(output_file, 'w', encoding='utf-8') as h:
h.write(content)


Expand Down

0 comments on commit fc12331

Please sign in to comment.