[issue41152] IDLE: revise setting of iomenu.encoding and .errors

Terry J. Reedy report at bugs.python.org
Mon Jun 29 01:36:21 EDT 2020


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I got the 'within iomenu' part a bit wrong.  To open a file to edit, iomenu.IOBinging('IO').open tells filelist to use IO.loadfile.  This reads bytes 'so that we can handle end-of-line convention ourselves'.  (I suspect that this predates 3.x and might not be needed any more.)  IO.loadfile calls IO._decode which looks for a utf-8 BOM, looks for a coding cookie, tries ascii (not needed in 3.x), tries utf-8, and asks the user for an encoding, using iomenu.encoding as the initial value in the query box.  This box is deprecated in the sense that for 3.x, a python file should either be utf-8 or have an encoding cookie.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41152>
_______________________________________


More information about the Python-bugs-list mailing list