fix: punktum app module fails to import on Python 3 - #10
Closed
serrebidev wants to merge 1 commit into
Closed
Conversation
`appModules/punktum.py` is encoded in cp1252 and carries German umlauts in its
first-line comment, but declares no PEP 263 encoding line. Python 3 assumes
UTF-8 in that case, so the 0xFC bytes abort the parse and the app module never
loads:
SyntaxError: Non-UTF-8 code starting with '\xfc' on line 1,
but no encoding declared
Re-encode the file as UTF-8, which is what Python 3 expects by default and what
every other module in the add-on already uses. Only the comment bytes change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUFZd6deUGuMmJYnLAvXxL
Author
|
Closing as a duplicate — the punktum UTF-8 re-encode is already covered by #7 and #8, which I missed before opening this. Note for whichever gets merged: the stray trailing dot on Sorry for the noise. |
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.
Problem
addon/appModules/punktum.pyis encoded in cp1252 and has German umlauts in its first-line comment, but declares no PEP 263 encoding line. Python 3 assumes UTF-8 when no declaration is present, so the file fails to parse and the Punktum app module never loads:The offending line is the comment itself:
It shows up as
ISO-8859 textrather than UTF-8, and it is the only module in the add-on in that state — every other file is already UTF-8.Fix
Re-encode the file as UTF-8. Only the two umlaut bytes change (
0xFCbecomes0xC3 0xBC); no code is touched, and no encoding declaration is needed since UTF-8 is the Python 3 default.Verified with
python -m py_compile, which fails before the change and succeeds after.