Skip to content

escape error log in command failure diagnostics #332

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhermann
Copy link

This prevents Unicode appearing in the error log of failed commands throwing encoding exceptions (thus obscuring the actual error), by using repr() to enforce pure ASCII.

Maybe not the best solution, but a robust one.

@codecov-io
Copy link

Current coverage is 92.76%

Merging #332 into master will decrease coverage by -0.05% as of 46c4094

@@            master    #332   diff @@
======================================
  Files           20      20       
  Stmts         1754    1755     +1
  Branches       303     303       
  Methods          0       0       
======================================
  Hit           1628    1628       
  Partial         33      33       
- Missed          93      94     +1

Review entire Coverage Diff as of 46c4094

Powered by Codecov. Updated on successful CI builds.

@bitprophet
Copy link
Member

Thanks for this! Can you provide some concrete examples of Unicode-bearing command output that triggers this, plus the stacktrace from before this is applied & then the one from after it's applied? Just want some hard details in front of me so I can make sure I grok it.

I get the basic need & have run into the "this is not my beautiful error" masking problem while poking #350, I just want to make sure I get what your solution is doing & make sure I can't come up with a slightly less baroque one :)

Offhand I'm assuming this is basically saying "give me every byte/char from every line of the output [then join them back etc]" as a way of cutting up any multibyte Unicode nasties - meaning the result could look pretty garbled in some situations (but, not causing errors, so...). But I'm not at all sure, thus the request for clarification.

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

Successfully merging this pull request may close these issues.

3 participants