bpo-36698: IDLE no longer fails when write non-encodable characters to stderr.#16583
Conversation
…o stderr. It now escapes them with a backslash, as the regular Python interpreter. Added the "errors" field to the standard streams.
| class PseudoInputFile(PseudoFile): | ||
| class StdInFile(StdioFile): | ||
|
|
||
| def __init__(self, shell, tags, encoding=None): |
There was a problem hiding this comment.
| def __init__(self, shell, tags, encoding=None): | |
| def __init__(self, shell, tags, encoding, errors): |
Leave the default to StdioFile and add the new errors parameter. If change 'tags' to 'tag' elsewhere, do so here also.
|
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be poked with soft cushions! |
|
Thank you for the patch. On Windows, the change is that \ud800 is printed with the escape code instead a replacement box. Otherwise, the patch looks good to me as cleanup and update. I tested that nothing else changed by running test/test_idle from IDLE editor (output on stderr) and separately testing stdin and stdout by running |
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
…o stderr. (pythonGH-16583) It now escapes them with a backslash, as the regular Python interpreter. Added the "errors" field to the standard streams. (cherry picked from commit b690a27) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
GH-16649 is a backport of this pull request to the 3.8 branch. |
…o stderr. (pythonGH-16583) It now escapes them with a backslash, as the regular Python interpreter. Added the "errors" field to the standard streams. (cherry picked from commit b690a27) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
GH-16650 is a backport of this pull request to the 3.7 branch. |
…o stderr. (pythonGH-16583) It now escapes them with a backslash, as the regular Python interpreter. Added the "errors" field to the standard streams.
It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
https://bugs.python.org/issue36698