Skip to content

fix: add encoding="utf-8" to paper_storage.py meta.json reads - #99

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

fix: add encoding="utf-8" to paper_storage.py meta.json reads#99
cmacd89 wants to merge 1 commit into
OpenNSWM-Lab:mainfrom
cmacd89:fix/paper-storage-encoding

Conversation

@cmacd89

@cmacd89 cmacd89 commented Aug 30, 2026

Copy link
Copy Markdown

Most open() calls in paper_storage.py already specify encoding="utf-8" (lines 356, 372, 424), but two read paths -- get_paper at line 100 and list_papers at line 112 -- were missing it. This means they fall back to the platform default encoding, which can corrupt or reject non-ASCII paper titles and author names on non-UTF-8 systems.

This PR adds encoding="utf-8" to those two calls, bringing them in line with the rest of the file.

What changed:

  • backend/app/storage/paper_storage.py: 2 lines changed (lines 100, 112)
  • backend/tests/test_pr_03_paper_storage_encoding.py: round-trip tests with Chinese and accented text

How verified: Both tests pass in the sandbox container (2/2 passed).

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