Generated scripts can be written in a bogus encoding
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
open's encoding argument, when unspecified, uses locale.getpreferredencoding
, which is not necessarily UTF-8. However, the generated script doesn't include an encoding cookie and can contain non-ASCII data if, say, the shebang path contains non-ASCII components. Either always open the file with encoding='utf-8' or write out an encoding cookie.
This has resulted in an issue filed on a different project: https://github.com/pypa/pipenv/issues/1265
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in setuptools/command/easy_install.py at lines 836-837 and inspect how generated scripts are opened and written. Verify the result with a non-ASCII shebang path under a non-UTF-8 locale; the work is done when generated scripts remain valid regardless of the locale encoding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100