Repository navigation
fix: accept UTF-8 BOM in bundler JSON readers - #5557
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change adding support for a single leading UTF-8 BOM in JSON readers.
No open issues 🎉
What changed in this PR
Fixes #5556 by allowing bundler JSON readers to accept a single leading UTF-8 BOM, supporting catalogs created with Windows PowerShell 5.1.
Changes:
- Handles a leading BOM in file-based and string-based JSON readers while preserving Unicode content.
- Adds coverage for valid BOM-prefixed input and rejection of invalid input.
- Adds a catalog add/offline search regression test.
Before-and-after regression results are reported in the PR; they were not rerun here.
| File | Description |
|---|---|
| tests/specify_cli/bundles/test_yamlio.py | Tests BOM handling, Unicode preservation, and invalid-input rejection. |
| tests/specify_cli/bundles/catalog/test_command_add.py | Tests adding and searching a BOM-prefixed catalog. |
| src/specify_cli/bundles/yamlio.py | Accepts one leading BOM in both JSON readers. |
Review effort: Balanced (adaptive)
|
Please fix CI/CD errors |
|
Updated On behalf of chelsealong: Codex (GPT-6) autonomously authored this change and reply and ran the listed checks; reasoning effort was not exposed. No human review or testing is claimed. Commit: f7b13b5 |
|
Added On behalf of chelsealong: Codex (GPT-6) autonomously authored the tests and this reply and ran the listed checks; reasoning effort was not exposed. No human review or testing is claimed. Commit: 555d0d9 |
There was a problem hiding this comment.
🔵 Needs a closer look
Switching load_json to FileHelper’s scoped filesystem backend changes symlink confinement and platform-specific access semantics beyond BOM decoding, requiring human compatibility review.
No open issues 🎉
Review effort: Balanced
|
Thanks for the BOM fix and the regression coverage. Could we keep the existing AI disclosure: GitHub Copilot (GPT-6.2 Sol, interactive mode) reviewed the patch, checked the migration guard, and drafted this comment on behalf of @mnriem, who authorized posting. |
|
Updated On behalf of chelsealong: Codex (GPT-6, autonomous mode; reasoning effort not exposed) authored the change, test, and this reply and ran the reported checks. No human review or testing is claimed. Commit: 22ae96e |
|
Thank you! |
Description
Fixes #5556. Bundler JSON readers accept one leading UTF-8 BOM while preserving non-ASCII text and U+FEFF inside JSON strings. Doubled or misplaced BOMs, malformed JSON, and duplicate catalog keys still raise BundlerError.
load_json()retains itspath.open()behavior.A regression test exercises
specify bundle catalog addand offlinebundle searchwith a BOM-prefixed catalog. It failed on the original source and passes with this change. A symlink regression fails with the FileHelper read and passes with the restored file open.Testing
.venv/bin/specify --help.venv/bin/python -m pytest tests/specify_cli/bundles -q— 1,326 passedgit diff --checkAI Disclosure
AI disclosure: Codex (GPT-6), autonomous executor; reasoning effort was not exposed. Codex authored the code and tests and ran the reported checks. No human review or testing is claimed.