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

do not exit on unicode errors #104

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

jsiverskog
Copy link
Contributor

i got this after updating jlink to 7.52c:

Traceback (most recent call last):
  File "pylink/jlink.py", line 323, in <lambda>
    self.detailed_log_handler = lambda s: (detailed_log or logger.debug)(s.decode())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa6 in position 26: invalid start byte

i'm not sure exactly why it happens, but i think it's reasonable to handle it more graceful.

@hkpeprah
Copy link
Contributor

hkpeprah commented Aug 17, 2021

Sorry for the late response here. I think we might be able to make use of the errors key-word argument of .decode() instead of wrapping in a try-catch. Could you try decode(errors='ignore') or even decode(errors='replace')?

@hkpeprah hkpeprah self-requested a review August 17, 2021 01:54
@jsiverskog
Copy link
Contributor Author

Sorry for the late response here. I think we might be able to make use of the errors key-word argument of .decode() instead of wrapping in a try-catch. Could you try decode(errors='ignore') or even decode(errors='replace')?

absolutely, that's a nicer solution. commit updated!

Copy link
Contributor

@hkpeprah hkpeprah left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix. Will merge, and cut a new patch release later on.

@hkpeprah hkpeprah added the bug label Aug 18, 2021
@hkpeprah hkpeprah merged commit 3618983 into square:master Aug 18, 2021
@hkpeprah
Copy link
Contributor

Fix should be available in v0.10.1.

@jsiverskog
Copy link
Contributor Author

thanks!

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

2 participants