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

Fix issue 830 - Make fails with UnicodeDecodeError #915

Merged
merged 7 commits into from
Mar 26, 2018

Conversation

steffengraber
Copy link
Contributor

This pull request fix issue #830 by using the io.open() instead of the open() statement and adding encoding="utf8" to it.

@heplesser heplesser added T: Bug Wrong statements in the code or documentation ZC: Installation DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL S: High Should be handled next I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Mar 20, 2018
@heplesser heplesser added this to the NEST 2.16 milestone Mar 20, 2018
Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

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

@steffengraber This looks very fine already, just two places where I would prefer os.path.join().

@@ -134,12 +135,14 @@ def write_help_html(doc_dic, helpdir, fname, sli_command_list, keywords):
else:
path = os.path.join(helpdir, 'cc')

f_file_name = open('{}/{}.html'.format(path, name), 'w')
f_file_name = io.open('{}/{}.html'.format(path, name), mode='w',
encoding='utf-8')
Copy link
Contributor

Choose a reason for hiding this comment

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

Please build the file name as

os.path.join(path, '{}.html'.format(name))

"{}/{}.html".format(path, name)
f_file_name.write(cmdindexstring)
f_file_name.close()

f_file_name_hlp = open('{}/{}.hlp'.format(path, name), 'w')
f_file_name_hlp = io.open('{}/{}.hlp'.format(path, name), mode='w',
encoding='utf-8')
Copy link
Contributor

Choose a reason for hiding this comment

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

Please build the file name as

os.path.join(path, '{}.html'.format(name))

Copy link
Contributor

@hakonsbm hakonsbm left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@heplesser heplesser merged commit a3729fd into nest:master Mar 26, 2018
@steffengraber steffengraber deleted the fix-issue-830 branch March 5, 2019 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: High Should be handled next T: Bug Wrong statements in the code or documentation ZC: Installation DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants