Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

serhiy-storchaka
Copy link
Member

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

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.
return self.shell.write(s, self.tags)


class PseudoInputFile(PseudoFile):
class StdInFile(StdioFile):

def __init__(self, shell, tags, encoding=None):
Copy link
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.

@bedevere-bot
Copy link

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!

@terryjreedy
Copy link
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
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

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

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