-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Sudo usage breaks pip. #982
Comments
related comment: https://github.com/pypa/pip/pull/780/files#r4330003 |
2 side points:
|
Thanks, very good to know its going to be fixed. |
cc @d1b this problem is not universal. I don't have this issue on ubuntu or centos. can you give me the results from these:
|
This is RHEL6.2 -bash-4.1$ sudo python -c "import getpass; print(getpass.getuser())" |
thanks @harlowja . all my answers were 'root'. |
Ya, thats pretty weird. I wonder if since RHEL6.2 uses 2.6 that 2.6 has this behavior? But then centos should also. Pretty odd... |
@qwcode this is very interesting indeed. On ubuntu 13.04 with python 2.7.4, prints out 'root'. It would seem that 'sudo' on some systems end up with environmental variables that differ from the norm. So we should change it to be |
Same issue for me on OSX. Build dirs are created as root if running via sudo. I was going to write an issue but this seems to cover it. In this case I was using virtualenv and virtualenvwrapper, I accidently used sudo pip install markdown, Ctrl+c'ed quickly, tried the command without sudo and sure enough I couldn't write to the build dir. |
@russkel what's the output you see (from pip) ? |
@d1b this is what it chucked out. I rm'ed the dir as sudo and I am on my merry way.
|
From my shell backlog: |
@russkel the issue you hit is not related to this issue (afaik). |
@d1b I started to make the change to use |
@qwcode sure thing. |
Fix #982 by using the effective user id on unix systems instead of depen...
- Some style adjustments. - Use SRC_REPOS for mapping repo name to source repository name. - Split the build_binary into individual tiny functions. - Fix up the progress bars and iterable logging. - Ensure that we log that we wrote to /etc/yum.repos.d and leave a trace for later cleanup. - Quiet some of the new executes (and put there output to files). - Add a smithy clean_pip() function that will help avoid hitting pypa/pip#982 - Further cleanup of smithy after it being partially rewritten. - Instead of hard coding 'conf/distros/rhel.yaml' in smithy, take this from the sourced file. - Ensure that we can't remove packages smithy requires to operate. - Ensure the package version that py2rpm is building is also trimmed of zeros. Change-Id: I2df8a47f0115de2684777b64db42e08d50ef4115
Any usage of sudo + pip (not in a venv) seems to break pip due to the new temporary directory check & mkdir creation. A simple easily reproducible example that includes one command and a second command that will break due to the new directory uid check (which doesn't play nice with sudo).
It would seem that --help (and likely other commands) should work for all users, and not require write access to some temporary folder for building (when --help is not a build command).
It also works the other way around (which is likely even worse since now any pip command the user will try to do will not work from here on out due to the user not being able to write a directory that is root owned).
The text was updated successfully, but these errors were encountered: