[issue28365] IDLE: don't offer to save text files as .py

2016-10-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

PS. A.J., you will likely be a happier user if you make a subdirectory under 
c:/Users/angie and put your files there instead of in the installation 
directory under the hidden AppDate

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28365] IDLE: don't offer to save text files as .py

2016-10-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am closing this as a duplicate of existing #21140, to make .txt instead of 
.py the extension for files known not to be code files.  I There is an existing 
simple patch.  I will modify it to not even offer .py as a secondary choice.

The reason Paul had to close IDLE to open the file in an(other) editor window 
is that Python allows only one editor window per file, and Shell is a subclass 
of OutputWindow, which is a subclass of EditorWindow. (The latter inheritance 
is backwards; OutputWindow should be the base TextEditor and 'CodeEditor' a 
subclass thereof.) When Shell is saved, the file name appears on the recent 
files list, and attempts to open it make the exiting editor the active window. 

Angie, as Paul explained, your screenshot shows a text file, mislabeled as a 
.py python file, in the editor.  When you run non-code text as code, you get a 
SyntaxError.  The text file appears to be a saved interactive shell session.  
"Python 3" by itself is a SyntaxError and will continue to be an error no 
matter what follows.

It is possible that your Python installation, or the IDLE part of it, is badly 
broken, and needs to be repaired or re-installed.  But I think it much much  
more likely that you have made a mistake.  If you want to discuss this further, 
please post to python-list (or its news.gmane.org mirror).  Include a link to 
this issue, give a detailed description of what you did (keystrokes and mouse 
clicks), and ask any questions.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Idle: saving Shell or an OutputWindow should default to .txt
title: idle forgets that saved console session is not a python file after 
restart -> IDLE: don't offer to save text files as .py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com