[issue41691] Idle 3.8.5 on Win64 won't save a file if it didn't include a newline when it was opened (ex: opening empty file)

2020-09-02 Thread David Crespo


David Crespo  added the comment:

Thanks for your answers. I tried to search if the bug was already reported 
using some text searches but I couldn't find it so I opened a new one. Next 
time I'll try what you recommend.

Regards and thanks for keeping Python in good shape!

--

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



[issue41691] Idle 3.8.5 on Win64 won't save a file if it didn't include a newline when it was opened (ex: opening empty file)

2020-09-02 Thread David Crespo


New submission from David Crespo :

Idle won't save a file if it didn't include a newline when it was opened (ex: 
opening empty file)

Steps for reproducing the error:
1) get into some folder in Windows File Explorer
2) right-click on empty space for context menu
3) click new -> create text file
4) rename to test.py
5) right click on test.py for context menu
6) click Edit with Idle -> Edit with Idle 3.8 64-bit
7) write some code, ex: print('hello, world!)
8) try to save the file with CTRL+S, or menu file->save, file->save as or 
file->save a copy

IDLE will silently refuse to save the file, the 'not saved' asterisk will 
remain next to the file name and no file is written.

I am using a workaround for this since creating empty files and editing them is 
part of my usual workflow.

If I edit the file with another text editor, save it, and then open it from the 
context menu, it can be saved after editing, but ONLY if i put a newline in the 
file from the alternate text editor. If my the file does NOT contain any 
newline at opening time, IDLE refuses to save it.

This error (refusing to save) seems to happen also when opening from menu 
file->open any file which does NOT contain any newline.

Regards.

--
assignee: terry.reedy
components: IDLE
messages: 376228
nosy: dcrespo3d, terry.reedy
priority: normal
severity: normal
status: open
title: Idle 3.8.5 on Win64 won't save a file if it didn't include a newline 
when it was opened (ex: opening empty file)
type: behavior
versions: Python 3.8

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