-
Notifications
You must be signed in to change notification settings - Fork 358
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
Conversation
There was a problem hiding this 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()
.
extras/help_generator/writers.py
Outdated
@@ -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') |
There was a problem hiding this comment.
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))
extras/help_generator/writers.py
Outdated
"{}/{}.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') |
There was a problem hiding this comment.
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))
There was a problem hiding this 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.
This pull request fix issue #830 by using the
io.open()
instead of theopen()
statement and addingencoding="utf8"
to it.