New submission from Roger Serwy <[email protected]>:
The interactive interpreter in IDLE does not reset its compiler __future__
flags when you restart the shell.
To verify this, type into the shell:
>>> from __future__ import barry_as_FLUFL
>>> 1 != 2
You'll get a syntax error. Restart the shell and type
>>> 1 != 2
A syntax error still occurs.
The ModifiedInterpreter class in PyShell.py ultimately relies on codeop to
mimic the interactive prompt. The codeop module was created specifically for
remembering __future__ flags for subsequent commands.
The provided patch stores the flags of the interpreter when it first
initializes, and then restores them in "restart_subprocess". It's a patch
against 3.2.2.
----------
components: IDLE
files: patch_future.diff
keywords: patch
messages: 146646
nosy: ezio.melotti, serwy
priority: normal
severity: normal
status: open
title: IDLE: __future__ flags don't clear on shell restart
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file23557/patch_future.diff
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13296>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com