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

2020-06-29 Thread miss-islington
miss-islington added the comment: New changeset 00fd04b9b7537c473c3f9396a861868b8ddd3bb2 by Miss Islington (bot) in branch '3.8': bpo-41152: IDLE: always use UTF-8 for standard IO streams (GH-21214) https://github.com/python/cpython/commit/00fd04b9b7537c473c3f9396a861868b8ddd3bb2 --

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

2020-06-29 Thread miss-islington
miss-islington added the comment: New changeset 01638ce51a63afe5af3f778e7403702703bb41b9 by Miss Islington (bot) in branch '3.9': bpo-41152: IDLE: always use UTF-8 for standard IO streams (GH-21214) https://github.com/python/cpython/commit/01638ce51a63afe5af3f778e7403702703bb41b9 --

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

2020-06-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +20379 pull_request: https://github.com/python/cpython/pull/21226 ___ Python tracker ___ __

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

2020-06-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20378 pull_request: https://github.com/python/cpython/pull/21225 ___ Python tracker _

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

2020-06-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 2515a28230b1a011205f30263da6b01c6bd167a3 by Serhiy Storchaka in branch 'master': bpo-41152: IDLE: always use UTF-8 for standard IO streams (GH-21214) https://github.com/python/cpython/commit/2515a28230b1a011205f30263da6b01c6bd167a3 --

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

2020-06-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 21214 sets the encoding of stdin/stdout/stderr to 'utf-8'. Error handler is set to 'surrogatepass' or 'surrogateescape' because these error handlers are used when convert strings between Python and Tcl. It guarantees that reading from stdin and writing

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

2020-06-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +20367 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21214 ___ Python tracker ___ _

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

2020-06-28 Thread Terry J. Reedy
Terry J. Reedy 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 b

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

2020-06-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: The main use for the iomenu settings is for the socket-transport file classes, in run.py. The default encoding='utf-8' and errors='strict' are not used but are overriden with the iomenu values, or for stderr, 'backslashreplace'. Since user code can print an

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

2020-06-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: The PR is for 1. The *nix code is a bit clearer without the Windows code in the middle. Is there a good reason why when encoding is 'utf-8', errors should be 'surrogateescape' on Windows and 'strict' elsewhere? Surrogateescape seems like it is made for wh

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

2020-06-28 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +20361 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21206 ___ Python tracker __

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

2020-06-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it makes sense if we want to use the locale encoding for IO streams. But on other hand, it may be worth to drop support of locale-depending and configurable IO encoding and always use UTF-8. It is the IO encoding always used on Windows and the enco

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

2020-06-28 Thread Terry J. Reedy
New submission from Terry J. Reedy : When testing and on Windows, iomenu.encoding and .errors are set to utf-8 and surrogateescape*. When running otherwise, these are set with baroque code I don't understand. (Currently lines 31 to 61.) 1. Combine the two conditional statements for testing