[issue28365] 3.5.2 syntax issue

Paul Moore report at bugs.python.org
Wed Oct 5 13:25:59 EDT 2016


Paul Moore added the comment:

I can recreate this (based on the screenshots from #28366).

To reproduce, open IDLE. You get the console banner and prompt. Save that file using File-Save. The close IDLE. Reopen it, do File-Open to open your saved console session, then use the "Run" menu to run it. (You need to close IDLE, so it "forgets" the .py file came from a console session.)

That's incorrect usage, of course (not "of course" to the OP - that's the real point here) as the text of a console session isn't a valid Python file, and doesn't syntax check. The error is saying precisely that - what is in the file isn't valid Python.

So in one sense, this is simply user error. But I wonder, is there something about how IDLE presents things that could be improved? Either in the documentation or in the UI? I'm not exactly sure what the point of "file-save" in a console window is, and certainly it would be better to save the transcript as text so it couldn't be inadvertently be read back in as a Python module.

I'm not an IDLE user, though, so I don't really have the background to know the best solution.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28365>
_______________________________________


More information about the Python-bugs-list mailing list