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

UnicodeDecodeError caught for json_loads #465

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

Conversation

john-corcoran
Copy link

Hi, I encountered a UnicodeDecodeError when reading some data that was quite badly corrupted. This occurred when iterating through a JSONResultsReader. Error occurred using Python 3.10.5.

Error was:

UnicodeDecodeError: 'utf-8' codec can't decode byte [val] in position [val]: invalid continuation byte

The stacktrace points to json.loads (imported as json_loads) - this pull request catches the exception and re-reads, ignoring the decode error. It may be beneficial to raise a warning to the user, but apologies as I'm not familiar enough with the codebase for that just yet :)

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.

1 participant