chore: open files with encoding=utf-8 - #194
Open
SoundMatt wants to merge 1 commit into
Open
Conversation
cpodalak
approved these changes
Jun 5, 2026
Collaborator
|
@SoundMatt, checks faiiling.. ⬆️ |
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
SoundMatt
force-pushed
the
fix/spec-history-utf8-encoding
branch
from
June 15, 2026 15:08
2694215 to
8014cef
Compare
Author
|
@cpodalak — the CI hasn't run yet because this is a fork PR and needs a maintainer to click "Approve and run" on the Actions tab to trigger the workflows. The commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three
open()calls in the spec_history modules read or wrote files without specifyingencoding="utf-8", falling back to Python's locale-dependent default. On Windows or systems whose default locale isn't UTF-8, GraphQL type definitions and JSON-LD spec history files containing non-ASCII characters in descriptions or comments would be silently corrupted (write side) or fail to parse (read side).Sites fixed:
src/s2dm/exporters/spec_history.py:247— type-definition writesrc/s2dm/registry/spec_history.py:71— JSON loadsrc/s2dm/registry/spec_history.py:80— JSON-LD saveThe other
open()calls in the codebase (vspec.py,cli.py,concept_uri.py,naming_config.py,variant_ids.py) already passencoding="utf-8"correctly. This brings the spec_history modules in line.No behaviour change on macOS/Linux where the default locale is already UTF-8. Local verification: 532 tests pass.