Skip to content

fix: add encoding="utf-8" to review_storage.py open() calls - #87

Open
nathaq wants to merge 1 commit into
OpenNSWM-Lab:mainfrom
nathaq:fix/review-storage-encoding
Open

fix: add encoding="utf-8" to review_storage.py open() calls#87
nathaq wants to merge 1 commit into
OpenNSWM-Lab:mainfrom
nathaq:fix/review-storage-encoding

Conversation

@nathaq

@nathaq nathaq commented Aug 30, 2026

Copy link
Copy Markdown

Hey! I noticed that review_storage.py has 9 open() calls that read and write JSON files without specifying encoding="utf-8". On systems where the default locale is not UTF-8 (Windows with cp1252, minimal containers), this will either corrupt non-ASCII data silently or throw UnicodeDecodeError.

The fix adds encoding="utf-8" to every text/JSON open() call in the file -- both reads (get_review, list_reviews, list_improvement_requests, get_improvement_request) and writes (_save_record, create_improvement_request, update_improvement_request).

review_storage.py handles review reports, findings, and improvement request descriptions -- all of which regularly contain non-ASCII text (Chinese, accented characters, etc.), so this is especially important here.

Files changed:

  • backend/app/storage/review_storage.py -- added encoding="utf-8" to 9 open() calls
  • backend/tests/test_pr_02_review_encoding.py -- round-trip tests with Chinese and accented text

Verified: All 3 tests pass in the sandbox container.

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