Skip to content

fix: read the pattern file as UTF-8 instead of the locale encoding - #10

Open
kdeldycke wants to merge 1 commit into
pacha:mainfrom
kdeldycke:fix-pattern-file-encoding
Open

kdeldycke wants to merge 1 commit into
pacha:mainfrom
kdeldycke:fix-pattern-file-encoding

Conversation

@kdeldycke

Copy link
Copy Markdown

get_parser_from_file reads the pattern file with Path.read_text() and no encoding argument:

The patterns then depend on the locale of the process. Under a locale that is not UTF-8, a pattern with a non-ASCII character does not match a path that git check-ignore matches. This change reads the file as UTF-8.

Python 3.14 and earlier use the locale encoding when encoding is not given (open()). Python 3.15 turns UTF-8 mode on by default (PEP 686).

kdeldycke added a commit to kdeldycke/repomatic that referenced this pull request Oct 13, 2026

This branch has not been deployed

No deployments
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