[New-bugs-announce] [issue41373] IDLE: edit/save files created by Windows Explorer

Terry J. Reedy report at bugs.python.org
Wed Jul 22 23:47:16 EDT 2020


New submission from Terry J. Reedy <tjreedy at 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 <report at bugs.python.org>
<https://bugs.python.org/issue41373>
_______________________________________


More information about the New-bugs-announce mailing list