mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #2311 from dstufft/fix-windows-more
Remove some other places we called os.geteuid()
(cherry picked from commit 40ef6da47a
)
This commit is contained in:
parent
6f32138a14
commit
86205b1fac
6 changed files with 7 additions and 6 deletions
|
@ -1,5 +1,7 @@
|
|||
**6.0.6 (2015-01-03)**
|
||||
|
||||
* Continue the regression fix from 6.0.5 which was not a complete fix.
|
||||
|
||||
|
||||
**6.0.5 (2015-01-03)**
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ class Command(object):
|
|||
|
||||
# Ensure that the path for our debug log is owned by the current user
|
||||
# and if it is not, disable the debug log.
|
||||
write_debug_log = check_path_owner(debug_log_path, os.geteuid())
|
||||
write_debug_log = check_path_owner(debug_log_path)
|
||||
|
||||
logging_dictConfig({
|
||||
"version": 1,
|
||||
|
|
|
@ -234,7 +234,7 @@ class SafeFileCache(FileCache):
|
|||
# we will check the parent directory until we find one that does exist.
|
||||
# If it is not owned by the user executing pip then we will disable
|
||||
# the cache and log a warning.
|
||||
if not check_path_owner(self.directory, os.geteuid()):
|
||||
if not check_path_owner(self.directory):
|
||||
logger.warning(
|
||||
"The directory '%s' or its parent directory is not owned by "
|
||||
"the current user and the cache has been disabled. Please "
|
||||
|
|
|
@ -4,7 +4,7 @@ import os.path
|
|||
from pip.compat import get_path_uid
|
||||
|
||||
|
||||
def check_path_owner(path, uid):
|
||||
def check_path_owner(path):
|
||||
# If we don't have a way to check the effective uid of this process, then
|
||||
# we'll just assume that we own the directory.
|
||||
if not hasattr(os, "geteuid"):
|
||||
|
|
|
@ -60,8 +60,7 @@ class GlobalSelfCheckState(object):
|
|||
|
||||
def save(self, pypi_version, current_time):
|
||||
# Check to make sure that we own the directory
|
||||
if not check_path_owner(
|
||||
os.path.dirname(self.statefile_path), os.geteuid()):
|
||||
if not check_path_owner(os.path.dirname(self.statefile_path)):
|
||||
return
|
||||
|
||||
# Now that we've ensured the directory is owned by this user, we'll go
|
||||
|
|
|
@ -128,7 +128,7 @@ def test_global_state(monkeypatch):
|
|||
def fake_lock(filename):
|
||||
yield
|
||||
|
||||
monkeypatch.setattr(outdated, "check_path_owner", lambda p, u: True)
|
||||
monkeypatch.setattr(outdated, "check_path_owner", lambda p: True)
|
||||
|
||||
monkeypatch.setattr(lockfile, 'LockFile', fake_lock)
|
||||
|
||||
|
|
Loading…
Reference in a new issue