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

Fix import and agendaupdate to handle encoding errors more gracefully #705

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

dbarnett
Copy link
Collaborator

Configures file arguments with errors='replace' so that if they encounter characters they can't encode/decode they'll just replace them with a replacement marker such as '?' instead of raising an exception.

Fixes #387 (probably)

Configures file arguments with errors='replace' so that if they
encounter characters they can't encode/decode they'll just replace them
with a replacement marker such as '?' instead of raising an exception.

Fixes #387 (probably)
@dbarnett
Copy link
Collaborator Author

This should help fail more gracefully and I can't think of any particular downside, besides maybe that it's a bit too silent if it hits an encoding/decoding issue.

If people still run into these kinds of issues, some other ideas to try:

  • Assume utf-8 encoding instead of platform-dependent?
  • Dynamically retry with another encoding if the default fails and utf-8 or some other encoding might work?

But it would be good to flush out the queue of very old reports, get a conservative fix out there, and understand what issues might still remain (and what encodings might actually be involved in practice in those cases).

@dbarnett dbarnett merged commit 0b88004 into master Aug 25, 2024
16 checks passed
@dbarnett dbarnett deleted the win32_unicode branch August 25, 2024 00:45
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.

UnicodeEncodeError: 'charmap' codec on Windows in some scenarios
1 participant