Skip to content

Read README as UTF-8 in setup#190

Open
CodingFeng101 wants to merge 1 commit into
gruns:masterfrom
CodingFeng101:codex/setup-readme-utf8
Open

Read README as UTF-8 in setup#190
CodingFeng101 wants to merge 1 commit into
gruns:masterfrom
CodingFeng101:codex/setup-readme-utf8

Conversation

@CodingFeng101

Copy link
Copy Markdown

Summary

This makes setup.py read README.md explicitly as UTF-8 before passing it as the package long description.

On Windows systems whose preferred locale encoding is not UTF-8, pip install -e . can fail while setup.py reads the README during editable-build metadata preparation. In my environment the default codec was GBK, and the README contains non-ASCII UTF-8 text, so setup failed before metadata generation completed.

Validation

  • Before this change, python -m pip install -e . nose2 flake8 failed with UnicodeDecodeError: 'gbk' codec can't decode byte 0x88 ... while reading README.md from setup.py.
  • After this change, python -m pip uninstall -y furl; python -m pip install -e . succeeds and builds the editable wheel.
  • python -m flake8 passes.
  • git diff --check passes.

I also ran python -m nose2; it currently fails on Python 3.12 with two invalid-bracketed-host ValueErrors and one odd URL assertion in existing URL parsing tests. Those failures are unrelated to this setup.py encoding change.

@CodingFeng101 CodingFeng101 marked this pull request as ready for review June 30, 2026 08:17
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