Skip to content

fix: add utf-8 encoding to extension and preset registry file I/O - #3834

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/extensions-registry-encoding
Open

fix: add utf-8 encoding to extension and preset registry file I/O#3834
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/extensions-registry-encoding

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Summary

Add explicit encoding='utf-8' to extension and preset registry file I/O to prevent corruption on non-UTF-8 Windows locales.

Changes

  • extensions/__init__.py: Added encoding='utf-8' to registry read/write
  • presets/__init__.py: Added encoding='utf-8' to registry read/write

Both extension and preset registry read/write calls used platform-default
encoding, which on Windows (cp1252/UTF-16) would corrupt UTF-8 JSON data
or raise UnicodeDecodeError. Explicitly specify encoding='utf-8' to match
the JSON contract.

Assisted-by: opencode (autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Ensures extension and preset registries consistently use UTF-8 across platforms.

Changes:

  • Added UTF-8 encoding to registry reads.
  • Added UTF-8 encoding to registry writes.
Show a summary per file
File Description
src/specify_cli/presets/__init__.py Uses UTF-8 for preset registry I/O.
src/specify_cli/extensions/__init__.py Uses UTF-8 for extension registry I/O.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Medium

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.

3 participants