[Idle-dev] [BUG]: Can not save anything on IDLE since v3.8.4!!
Terry Reedy
tjreedy at udel.edu
Thu Jul 23 00:08:09 EDT 2020
On 7/22/2020 6:51 AM, Eason Zhang wrote:
> Hello,
>
> I created a new py file that can be saved and run on IDLE v3.8.3.
> I also created a new py file on IDLE v3.8.4 but it can NOT be saved!
> Tried to edited an old version(e.g. v3.8.3) created py file on IDLE
> v3.8.4 , it can be saved! That's so strange!
>
> It still cannot save on current latest version v3.8.5!! I tested this
> function both on 32-bits and 64-bits and they are all CANNOT work!!
In response to my response about missing 'import io' and the fix on
3.8.5/3.9.0b5, Eason privately sent me
QUOTE"""""""""""""""""""""""""""""""""""""""""""""
Video1 (No bug on v3.8.3):
https://www.screencast.com/users/lonlon29/folders/Default/media/a0626e93-2c1c-4921-9560-955eb6111466
Video2(Bug was found on v3.8.5):
https://www.screencast.com/t/xrbA7bQpRbuZ
System environment:
Windows 8.1 64-bits OS and Windows 7 64-bits OS.
"""""""""""""""""""""""""""""""""""""""""""""""
System has Chinese set as its language. Video2 shows existing
C:/Users/Administrators/Documents/test.py
containing Chinese characters being edited, saved, and run multiple
times with 3.8.5. So he is not running into the 3.8.4 no non-ascii
chars bug.
In my response, I said Eason might be running into another issue.
Videa2 continues with Windows 7/8.1 File Explorer > Create New > Text
file* > name 385.py > right click > Edit with IDLE 3.8. (*I cannot read
Chinese but recognize positions of clicks. 'Edit ...' is the English
installed by the python Windows installer.)
I did the same with 'Edit with IDLE 3.9' as for some reason my
installation of 3.8 did not add 'Edit with IDLE 3.8'. I had the same
no-save problem. When I tried editing the file from a command line with
C:\Users\Terry>py -3.8 -m idlelib f:/python/a/385.py
I got a traceback in Command Prompt ending with
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
I suspect that this is only a Windows issue. Someone with *nix or Mac
could check.
An immediate fix is to change the condition on the previous line,
iomenu.py, line 251.
if self.eol_convention not in (None, '', "\n"):
This or a better fix should be in the next release, likely 3.9.0rc1.
A new file created with File => New can be saved as usual.
--
Terry Jan Reedy
More information about the IDLE-dev
mailing list