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
__future__ imports fail when compiling from python ast #58586
Comments
GOAL ISSUE ANALYSIS The AST which I was compiling used the string "__future__" after extracting that string from a much longer string of user input, and as a result, the string was not interned. The attached file futureimport.py is a simple script demonstrating this issue. I have confirmed that the issue occurs in Python 2.7.2 and 3.2.2. |
Incidentally, the workaround that I'm using for the time being is to run the following code before attempting to compile root_node. for node in ast.walk(root_node):
if isinstance(node, ast.ImportFrom) and node.module == '__future__':
node.module = '__future__' |
New changeset f57cbcefde34 by Benjamin Peterson in branch '3.2': New changeset 9d793be3b4eb by Benjamin Peterson in branch 'default': |
After this commit the buildbots are dying randomly with segfaults. |
New changeset 1729ec440bb6 by Benjamin Peterson in branch '2.7': |
1b467efb9b27 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: