fix(xpip): never add sudo, append --user instead (#4879)

This commit is contained in:
Gil Forsyth 2022-07-14 14:05:40 -04:00 committed by GitHub
parent c8c1fd1071
commit 649fad8a7c
Failed to generate hash of commit
2 changed files with 25 additions and 1 deletions

24
news/xpip_perms.rst Normal file
View file

@ -0,0 +1,24 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* <news item>
**Security:**
* ``xpip`` will never add ``sudo`` under any circumstances and will instead append ``--user`` as needed

View file

@ -815,7 +815,7 @@ def detect_xpip_alias():
# XXX: Does windows have an installation mode that requires UAC?
return basecmd
elif not os.access(os.path.dirname(sys.executable), os.W_OK):
return ["sudo"] + basecmd
return basecmd.extend(["--user"])
else:
return basecmd
except Exception: