Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding encoding details #134

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rpft/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def flows_to_sheets(
:param numbered: Use sequential numbers instead of short reps for row IDs.
:returns: None.
"""
with open(input_file, "r") as f:
with open(input_file, "r",encoding='utf-8') as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: space after comma.

data = json.load(f)
container = RapidProContainer.from_dict(data)
for flow in container.flows:
Expand Down
2 changes: 1 addition & 1 deletion src/rpft/parsers/common/rowdatasheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def export(self, filename, file_format="csv"):
data = self.convert_to_tablib()
exported_data = data.export(file_format)
write_type = "w" if type(exported_data) is str else "wb"
with open(filename, write_type) as f:
with open(filename, write_type, encoding='utf-8') if write_type == "w" else open(filename, write_type) as f:
f.write(exported_data)

def convert_to_tablib(self):
Expand Down
Loading