-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Generated scripts can be written in a bogus encoding #1246
Comments
My intention for issues like this one is to replace Setuptools own script generation with that found in distlib. Plus, easy_install is generally deprecated. |
Sure. Even if |
The issue reported upstream implicates a script installed by |
Regardless of the upstream issue, do you see how this affects setuptools? I can reproduce this, but not exactly right now, as I don't have a windows box readily available. |
I do see how setuptools could be affected, but it's not clear to me that this is a use case we wish to support. I don't fully understand which factors are necessary to bring about these invalid encodings. In fact, if the system's preferred encoding is not UTF-8, perhaps that indicates that the system wishes not to have UTF-8 in the scripts. I don't feel strongly about it, but I do feel a little uneasy fixing a bug I've gone ahead and pushed a possible change to a branch. Would you review and confirm this is what you had in mind? |
Following up in the parent ticket, I see that in fact |
Being curious here, why does pip use setuptools when installing from source? Would it be plausible to also raise this issue in pip? |
Looks like it's already done. |
Is this related to #1400? |
setuptools/setuptools/command/easy_install.py
Lines 836 to 837 in 118edbb
open
'sencoding
argument, when unspecified, useslocale.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 withencoding='utf-8'
or write out an encoding cookie.This has resulted in an issue filed on a different project: pypa/pipenv#1265
The text was updated successfully, but these errors were encountered: