Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read pyproject.toml with correct encoding on Windows. #12105

Merged
merged 2 commits into from Feb 1, 2022

Conversation

domdfcoding
Copy link
Contributor

@domdfcoding domdfcoding commented Jan 31, 2022

Description

On Windows (where the default encoding for open is usually not UTF-8), attempting to load mypy's configuration from a pyproject.toml fails due to being unable to decode unicode characters. With this patch, the file is read with UTF-8 as the encoding on all platforms.

Fixes #11058

Test Plan

Added a test which loads mypy's configuration from a pyproject.toml file containing non-ASCII characters.

@domdfcoding domdfcoding marked this pull request as ready for review Jan 31, 2022
@domdfcoding domdfcoding changed the title Config unicode Read pyproject.toml with correct encoding on Windows. Jan 31, 2022
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Awesome, thank you!

@hauntsaninja hauntsaninja merged commit c0e49ab into python:master Feb 1, 2022
15 checks passed
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.

UnicodeDecodeError on Windows with pyproject.toml
2 participants