Skip to content
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

Bugfix: binary stdout/stderr handling #1129

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

arieleiz
Copy link
Contributor

_watch_pipe_fd() decodes the incoming data from the pipe using str::decode(). By default this passed the strict errors flag to the unicode engine. However, if the pipe command returns binary data this will through a UnicodeError exception.
We change the code to explicitly pass the replace errors flag, which will replace the output with output that can be displayed on screen.
We also specify the buffer size as a constant so it can be changed for edge cases where the task pipes a lot of output/error text.

_watch_pipe_fd() decodes the incoming data from the pipe using
str::decode(). By default this passed the 'strict' errors flag to
the unicode engine. However, if the pipe command returns binary data
this will through a UnicodeError exception.
We change the code to explicitly pass the 'replace' errors flag,
which will replace the output with output that can be displayed on
screen.
We also specify the buffer size as a constant so it can be changed for
edge cases where the task pipes a lot of output/error text.
@arieleiz arieleiz marked this pull request as draft June 26, 2023 11:20
@arieleiz arieleiz marked this pull request as ready for review June 26, 2023 11:22
@blink1073 blink1073 added the bug label Jun 29, 2023
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thank you!

@blink1073 blink1073 merged commit 0c1db09 into ipython:main Jun 29, 2023
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants