Repository navigation
Prevent PLY to overwrite its generated files. - #5728
Merged
Merged
Conversation
Ref astropy#5581, fixes astropy#5726. After astropy#5526 updated PLY to 3.9, some files were re-generated at runtime (astropy/coordinates/{angle_lextab.py,angle_parsetab.py}). This is because of this line https://github.com/dabeaz/ply/blob/master/ply/lex.py#L901 which assumes that the lextab parameter in `lex.lex` is a str only, not unicode, which leads to some surprise when unicode_literals is used on Python 2 ! So this commit just wraps the lextab value to make sure that a str is always passed to `lex.lex`.
Contributor
|
Great find! I was very confused indeed by why we needed the This will also remind us we can remove this work-around for astropy 3.0... |
Contributor
|
@bsipocz - Could you have a look too? You understand this better than I do... |
Member
|
Also need a change log. |
bsipocz
approved these changes
Jan 23, 2017
Member
|
Great investigating @saimn, thanks! It looks good to me. |
Contributor
Author
|
@mhvk - Done ! Also added the changelog entry. |
Contributor
|
OK, all looks great now, so merging (sorry for the bit of a delay). |
This was referenced Jan 25, 2017
Closed
bsipocz
pushed a commit
that referenced
this pull request
Feb 14, 2017
Prevent PLY to overwrite its generated files.
Member
|
This can probably be backported to 1.0.12, but it's not a clean cherry-pick, so I leave as is for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref #5581, fixes #5726.
After #5526 updated PLY to 3.9, some files were re-generated at runtime
(astropy/coordinates/{angle_lextab.py,angle_parsetab.py}). This is because of
this line https://github.com/dabeaz/ply/blob/master/ply/lex.py#L901 which
assumes that the lextab parameter in
lex.lexis a str only, not unicode, whichleads to some surprise when unicode_literals is used on Python 2 ! Then the
module is not imported, so it is regenerated.
So this commit just wraps the lextab value to make sure that a str is always
passed to
lex.lex. And it also reverts #5563 as wrapping in a try/except is nomore necessary.
cc @bsipocz @eteq @mhvk