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

Specify UTF-8 encoding when reading TOML files. #4

Merged
merged 4 commits into from
Jul 8, 2021
Merged

Specify UTF-8 encoding when reading TOML files. #4

merged 4 commits into from
Jul 8, 2021

Conversation

domdfcoding
Copy link
Contributor

This avoids a UnicodeDecodeError when reading pyproject.toml files containing unicode characters on Windows. These characters may be present in a project's metadata, such as its description or an author's name.

Furthermore, the TOML specification requires files to be encoded in UTF-8.

@domdfcoding
Copy link
Contributor Author

I can't directly test this on Windows because of xolox/python-humanfriendly#44, but the issue I was seeing goes away when using my branch.

@domdfcoding
Copy link
Contributor Author

I have had a go at making the test suite pass on Windows in my fork.

@codecov
Copy link

codecov bot commented Jul 4, 2021

Codecov Report

Merging #4 (0f57bd7) into master (c365c59) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #4   +/-   ##
=======================================
  Coverage   99.74%   99.74%           
=======================================
  Files           9        9           
  Lines         782      782           
  Branches      180      180           
=======================================
  Hits          780      780           
  Misses          1        1           
  Partials        1        1           
Impacted Files Coverage Δ
src/check_wheel_contents/config.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c365c59...0f57bd7. Read the comment docs.

@jwodder
Copy link
Owner

jwodder commented Jul 4, 2021

@domdfcoding Thank you very much! Please finish up the PR so I can merge it. I suppose I should add Windows to the CI matrix for future tests.

As for property-manager -> humanfriendly -> pyreadline causing problems, I believe I can replace it with functools.cached_property (or cached-property before Python 3.8).

@domdfcoding domdfcoding marked this pull request as ready for review July 6, 2021 14:54
@domdfcoding domdfcoding mentioned this pull request Jul 8, 2021
@domdfcoding
Copy link
Contributor Author

I think this is ready to go.

I have opened #22 to discuss Windows tests further.

@jwodder jwodder merged commit 0877fc6 into jwodder:master Jul 8, 2021
@jwodder jwodder added the bugfix Fixing something broken label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixing something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants