Skip to content

Fix encoding error - #17

Merged
jonmmease merged 1 commit into
masterfrom
encoding_error
Jul 23, 2020
Merged

Fix encoding error#17
jonmmease merged 1 commit into
masterfrom
encoding_error

Conversation

@jonmmease

Copy link
Copy Markdown
Collaborator

closes #13

With this PR, the standard error stream is collected as bytes (rather than being decoded for each line). Then if it becomes necessary to display it to the user, it is decoded with exception handling:

  • First trying sys.stderr.encoding
  • Then locale.getpreferredencoding(False)
  • Then falling back to stock message that decoding failed.

cc @WEGFan

Fix encoding error when reading standard error stream in certain systems
@WEGFan

WEGFan commented Jul 23, 2020

Copy link
Copy Markdown

I just tried and got no errors with the new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnicodeDecodeError cause by system encoding

2 participants