Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enforce UTF8 encoding because that is not default on Windows #254

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

Closed
wants to merge 1 commit into from
Closed

Enforce UTF8 encoding because that is not default on Windows #254

wants to merge 1 commit into from

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Jun 20, 2017

Fix #253

Also see astropy/sphinx-automodapi#29

UPDATE: Close #246

@lesteve
Copy link
Member

lesteve commented Jun 26, 2017

I think #246 had the right approach of always trying to use utf-8. The only thing is that I never had the time to understand why the tests were failing ...

@pllim
Copy link
Contributor Author

pllim commented Jun 26, 2017

If situation is dire enough, maybe this can be a "quick fix" until the other one has a chance to be investigated. This patch works for my use case and I have no motivation to investigate further.

else:
open_kwargs = {}

example_code_obj = identify_names(open(example_file, **open_kwargs).read())
Copy link
Member

Choose a reason for hiding this comment

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

This is not going to work on Python 2.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm running Python2 and it seems to work

Copy link
Contributor

Choose a reason for hiding this comment

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

... oh wait, I thought this was on my PR, never mind!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lesteve , what do you mean? The tests passed.

@pllim pllim closed this Jun 27, 2017
@pllim pllim deleted the win-py3-decode-error branch June 27, 2017 18:40
@Titan-C
Copy link
Member

Titan-C commented Jun 27, 2017

I get the feeling this PR and the corresponding issue #253 are not related to the problem being addressed in PR #246

@lesteve
Copy link
Member

lesteve commented Jun 28, 2017

I get the feeling this PR and the corresponding issue #253 are not related to the problem being addressed in PR #246

They are related in the sense that we should be using codecs.open(..., encoding='utf-8') instead of open everywhere in our source code otherwise the default platform encoding could be used, which is generally not what we want.

@Titan-C
Copy link
Member

Titan-C commented Jun 28, 2017

Indeed. I wasn't specific enough either. This PR is targeting other place in the codebase which is not what PR #246 is covering. We still need to fix it here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants