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

AST parsing in python 2 with encoding and shebang #3750

merged 4 commits into from Oct 17, 2018


Copy link

@jgsogo jgsogo commented Oct 15, 2018

Changelog: Bugfix: AST parsing of with shebang and encoding header lines was failing in python 2. This fix also allows non-ascii chars in if proper encoding is declared.

@ghost ghost assigned jgsogo Oct 15, 2018
@ghost ghost added the stage: review label Oct 15, 2018
@jgsogo jgsogo requested a review from memsharded Oct 15, 2018
@jgsogo jgsogo assigned lasote and memsharded and unassigned lasote Oct 15, 2018
@jgsogo jgsogo added this to the 1.8.3 milestone Oct 15, 2018
# Workaround for
lines_without_headers = []
lines = content.splitlines(True)
for line in lines:
Copy link

@memsharded memsharded Oct 15, 2018

It is not enough to remove the # encoding line?

Copy link
Member Author

@jgsogo jgsogo Oct 16, 2018

I put it later in the file to be able to parse/evaluate it... it can have non-ascii chars (and it reminds me that I need to add that in the test file! Thanks!)

Copy link
Member Author

@jgsogo jgsogo Oct 16, 2018

it already has non-ascii chars... there are several ¡Ñandú! as authors... 😆

@lasote lasote merged commit 45cff28 into conan-io:release/1.8.3 Oct 17, 2018
2 checks passed
@ghost ghost removed the stage: review label Oct 17, 2018
@jgsogo jgsogo deleted the issue/3749 branch Oct 17, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this issue Dec 27, 2018
* fix issue conan-io#3749 reported by @hanickadot

* do not split twice if not py2

* if there aren't headers, do not add a blank line

* handle blank lines at the end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants