Skip to content

utf-8 encoding fix & persister error logging#68

Merged
jacob-a-brown merged 11 commits into
mainfrom
jab-encoding-fix
May 27, 2026
Merged

utf-8 encoding fix & persister error logging#68
jacob-a-brown merged 11 commits into
mainfrom
jab-encoding-fix

Conversation

@jacob-a-brown

@jacob-a-brown jacob-a-brown commented May 26, 2026

Copy link
Copy Markdown
Contributor

Why

This PR addresses the following problem / context:

  • macOS defaults to utf-8 encoding, but Windows does not. This causes UnicodeEncodeError for Windows users
  • when a file fails to be dumped the reason why should be captured in the logs

How

Implementation summary - the following was changed / added / removed:

  • Write to files with utf-8 encoding explicitly defined
  • use try/except statements to log why a file failed to dump

Notes

Any special considerations, workarounds, or follow-up work to note?

  • Use bullet points here

Use UTF-8 encoding when writing to file in persister.py to fix encoding issues
that occur when the default encoding is not UTF-8. This ensures that all characters
are properly encoded and prevents errors when writing to the file.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to improve cross-platform file output reliability by explicitly setting text encodings when persisting CSV/GeoJSON outputs, addressing Windows default-encoding UnicodeEncodeError issues.

Changes:

  • Bumped package version from 0.10.2 to 0.10.3.
  • Added explicit encodings when writing CSV (utf-8-sig) and GeoJSON (utf-8) output files.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
setup.py Version bump to 0.10.3.
backend/persister.py Explicitly sets encodings for CSV/GeoJSON file writes to avoid platform-default encoding issues.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread backend/persister.py
Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated
@jacob-a-brown jacob-a-brown changed the title utf-8 encoding Fix utf-8 encoding fix & persister error logging May 26, 2026
@jacob-a-brown jacob-a-brown requested a review from Copilot May 26, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated
Comment thread backend/persister.py Outdated
Comment thread backend/persister.py
this preserves the original traceback, which is helpful for debugging.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread backend/persister.py
Comment thread backend/persister.py
Comment thread backend/persister.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread backend/persister.py
Comment thread backend/persister.py
Comment thread backend/persister.py
Comment thread backend/persister.py
Comment thread backend/persister.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@jacob-a-brown jacob-a-brown merged commit 40a29d4 into main May 27, 2026
@jacob-a-brown jacob-a-brown deleted the jab-encoding-fix branch May 27, 2026 17:11
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.

2 participants