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

Catch UnicodeDecodeError in lobster-json #102

Closed
phiwuu opened this issue Oct 17, 2024 · 0 comments · Fixed by #103
Closed

Catch UnicodeDecodeError in lobster-json #102

phiwuu opened this issue Oct 17, 2024 · 0 comments · Fixed by #103
Assignees
Labels
lobster-json Affects JSON integration

Comments

@phiwuu
Copy link
Member

phiwuu commented Oct 17, 2024

Opening input files, which are not encoded with UTF-8, might lead to an uncaught UnicodeDecodeError error.
This is not convenient for the user, only software developers will understand it.

I recommend to catch the error, print a meaningful message, and exit with error code 1.

This is the location where the error is raised:

data = json.load(fd)

See also #100

@phiwuu phiwuu added the lobster-json Affects JSON integration label Oct 17, 2024
@phiwuu phiwuu self-assigned this Oct 17, 2024
phiwuu added a commit that referenced this issue Oct 17, 2024
The `UnicodeDecodeError` is catched,
and an error message is printed.
Afterwards `lobster-json` exits.

Issue: #102
@phiwuu phiwuu linked a pull request Oct 17, 2024 that will close this issue
phiwuu added a commit that referenced this issue Oct 22, 2024
The `UnicodeDecodeError` is catched,
and an error message is printed.
Afterwards `lobster-json` exits.

Issue: #102
phiwuu added a commit that referenced this issue Oct 22, 2024
The `UnicodeDecodeError` is catched, and an error message is printed.
Afterwards `lobster-json` exits.

Issue: #102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lobster-json Affects JSON integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant