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 625 #627

Merged
merged 7 commits into from Sep 2, 2016
Merged

Fix 625 #627

merged 7 commits into from Sep 2, 2016

Conversation

@thomasballinger
Copy link
Member

thomasballinger commented Jul 29, 2016

fixing #625 by not adding encoding lines to source files.

@thomasballinger
Copy link
Member Author

thomasballinger commented Aug 4, 2016

Add a new default value for runsource(encode='auto'), which uses whether the filename is None to determine whether input is coming from an interactive interface and therefore needs to have an encoding comment added.

Add test for every combination of (unicode/bytestring x encoding comment/none x encode=True/False/'auto'). Some combinations are invalid and raise ValueErrors.

Pypy has slightly different syntax error message for
an encoding comment being present in a unicode string
@@ -284,6 +284,7 @@ def is_callable(obj):


get_encoding_re = LazyReCompile(r'coding[:=]\s*([-\w.]+)')
get_encoding_line_re = LazyReCompile(r'^.*coding[:=]\s*[-\w.]+.*$')

This comment has been minimized.

@sebastinas

sebastinas Aug 8, 2016

Contributor

So why do we need that twice?

This comment has been minimized.

@thomasballinger

thomasballinger Aug 8, 2016

Author Member

I can combine these

@sebastinas
Copy link
Contributor

sebastinas commented Aug 27, 2016

LGTM

@thomasballinger thomasballinger merged commit 9a88e73 into master Sep 2, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.