New submission from Terry J. Reedy <tjre...@udel.edu>:

#41300 fixed one bug in the patch for #41158.  A user reported another on on 
idle-dev list.  Create a file in Windows Explorer.  Leave as .txt or rename to 
.py.  Right click and Edit with IDLE 3.8 (.4/.5 or 3.9.0b4 or 5).  Edit works, 
Save (or Run) does not.  Open the same file from Command Prompt, change it, and 
trying to save produces

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Programs\Python38\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "C:\Programs\Python38\lib\idlelib\multicall.py", line 176, in handler
    r = l[i](event)
  File "C:\Programs\Python38\lib\idlelib\iomenu.py", line 200, in save
    if self.writefile(self.filename):
  File "C:\Programs\Python38\lib\idlelib\iomenu.py", line 232, in writefile
    text = self.fixnewlines()
  File "C:\Programs\Python38\lib\idlelib\iomenu.py", line 252, in fixnewlines
    text = text.replace("\n", self.eol_convention)
TypeError: replace() argument 2 must be str, not None

The replacement line is guarded with
        if self.eol_convention != "\n":
Either the condition should be include 'and self.eol_convention is not None' or 
the setting of the attribute should be changed.  I will look into how it was 
set before the #41158 patch.

----------
messages: 374119
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: edit/save files created by Windows Explorer
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41373>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to