Skip to content

bpo-36698: IDLE no longer fails when write non-encodable characters to stderr.#16583

Merged
serhiy-storchaka merged 2 commits into
python:masterfrom
serhiy-storchaka:idle-stderr-backslashreplace
Oct 8, 2019
Merged

bpo-36698: IDLE no longer fails when write non-encodable characters to stderr.#16583
serhiy-storchaka merged 2 commits into
python:masterfrom
serhiy-storchaka:idle-stderr-backslashreplace

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Oct 4, 2019

Copy link
Copy Markdown
Member

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

…o stderr.

It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
Comment thread Lib/idlelib/idle_test/test_run.py Outdated
Comment thread Lib/idlelib/pyshell.py Outdated
Comment thread Lib/idlelib/pyshell.py Outdated
Comment thread Lib/idlelib/run.py Outdated
class PseudoInputFile(PseudoFile):
class StdInFile(StdioFile):

def __init__(self, shell, tags, encoding=None):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment thread Lib/idlelib/run.py
Comment thread Lib/idlelib/run.py
Comment thread Lib/idlelib/run.py
Comment thread Lib/idlelib/run.py
Comment thread Lib/idlelib/run.py Outdated
@bedevere-bot

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be poked with soft cushions!

Comment thread Lib/idlelib/idle_test/test_run.py Outdated
@terryjreedy

Copy link
Copy Markdown
Member

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 input('prompt ') in a loop. I leave the *nix specific changes and testing to you.

@serhiy-storchaka serhiy-storchaka merged commit b690a27 into python:master Oct 8, 2019
@serhiy-storchaka serhiy-storchaka deleted the idle-stderr-backslashreplace branch October 8, 2019 11:32
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 8, 2019
…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>
@bedevere-bot

Copy link
Copy Markdown

GH-16649 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 8, 2019
…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>
@bedevere-bot

Copy link
Copy Markdown

GH-16650 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Oct 8, 2019
…o stderr. (GH-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>
miss-islington added a commit that referenced this pull request Oct 8, 2019
…o stderr. (GH-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>
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
…o stderr. (pythonGH-16583)

It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants