Skip to content

Use UTF-8 encoding when parsing pyproject.toml#1940

Merged
gaborbernat merged 5 commits intotox-dev:masterfrom
domdfcoding:issue-1908
Mar 3, 2021
Merged

Use UTF-8 encoding when parsing pyproject.toml#1940
gaborbernat merged 5 commits intotox-dev:masterfrom
domdfcoding:issue-1908

Conversation

@domdfcoding
Copy link
Copy Markdown

Fixes #1908

This avoids a UnicodeDecodeError when parsing pyproject.toml files containing 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.

Contribution checklist:

(also see CONTRIBUTING.rst for details)

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
  • added relevant issue keyword
    in message body
  • added news fragment in changelog folder
    • fragment name: <issue number>.<type>.rst for example (588.bugfix.rst)
    • <type> is must be one of bugfix, feature, deprecation,breaking, doc, misc
    • if PR has no issue: consider creating one first or change it to the PR number after creating the PR
    • "sign" fragment with "by :user:<your username>"
    • please use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files - by :user:superuser."
    • also see examples
  • added yourself to CONTRIBUTORS (preserving alphabetical order)

Copy link
Copy Markdown
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is still failing 🤔

Copy link
Copy Markdown
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Possible UnicodeError caused by missing encoding="utf-8"

2 participants