-
Notifications
You must be signed in to change notification settings - Fork 52
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
'astunparse.unparse' error with Python 3.8.1 #43
Comments
Hi! The code is directly based on the official 3.8 If you give me a specific (runnable) example, I'll take a look at it. |
I just made a PR (#44) to address this, as well as the case of b"" strings and others. Turns out that Python will not fill in |
I dont think this is a valid example, manually constructed nodes should have all fields specified by node. By the way |
@isidentical in which version?
|
It will be in 3.9, you can download alpha versions or compile your self to test it. |
@matkuki @tbennun Hi! Sorry for the late reply. Thanks for the report and the PR, however: Since this package is meant to be a replica of what was provides in the I suggest either updating the code that creates If you give me a use case where it's impossible to do any of the above, I may reconsider. |
For future references, what do you think about adding a note to the readme this tool is now exposed under |
I think this should be re-opened as Python's
and
|
I'm also running into this error on Python 3.8. I'm not sure I'm clear why this wasn't fixed. It works perfectly fine on Python 3.7 and fails on 3.8. 3.9 and above I use the base Python ast.unparse(). Bandit needs a way to suggest fixes and unparse modified ast nodes. I wanted to use this module, but will need Py3.8 support. |
Never mind, I think I can workaround this. Didn't realize the difference in how arguments in calls where the ast nodes differ in type between 3.7 and 3.8. |
Hi,
The following code throws an error when it parses a constant inside
some_code
:The traceback is:
A hack that fixes this is to comment out line 551 and 552 in
C:\Python38\lib\site-packages\astunparse\unparser.py
, like so:Regards
The text was updated successfully, but these errors were encountered: