[Python-checkins] gh-90473: disable user site packages on WASI/Emscripten (GH-93633)
tiran
webhook-mailer at python.org
Thu Jun 9 11:45:36 EDT 2022
https://github.com/python/cpython/commit/5a4af3ab030a3f3e708ee83d7d4ca3cb2d5b7360
commit: 5a4af3ab030a3f3e708ee83d7d4ca3cb2d5b7360
branch: main
author: Christian Heimes <christian at python.org>
committer: tiran <christian at python.org>
date: 2022年06月09日T17:45:29+02:00
summary:
gh-90473: disable user site packages on WASI/Emscripten (GH-93633)
files:
A Misc/NEWS.d/next/Library/2022-06-09-10-12-55.gh-issue-90473.683m_C.rst
M Lib/site.py
M Lib/sysconfig.py
diff --git a/Lib/site.py b/Lib/site.py
index b11cd48e69e9a..69670d9d7f223 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -266,8 +266,8 @@ def _getuserbase():
if env_base:
return env_base
- # VxWorks has no home directories
- if sys.platform == "vxworks":
+ # Emscripten, VxWorks, and WASI have no home directories
+ if sys.platform in {"emscripten", "vxworks", "wasi"}:
return None
def joinuser(*args):
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index e21b7303fecc6..bf926cf76807b 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -111,8 +111,8 @@ def _getuserbase():
if env_base:
return env_base
- # VxWorks has no home directories
- if sys.platform == "vxworks":
+ # Emscripten, VxWorks, and WASI have no home directories
+ if sys.platform in {"emscripten", "vxworks", "wasi"}:
return None
def joinuser(*args):
diff --git a/Misc/NEWS.d/next/Library/2022-06-09-10-12-55.gh-issue-90473.683m_C.rst b/Misc/NEWS.d/next/Library/2022-06-09-10-12-55.gh-issue-90473.683m_C.rst
new file mode 100644
index 0000000000000..b053a8e9a0813
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-06-09-10-12-55.gh-issue-90473.683m_C.rst
@@ -0,0 +1,2 @@
+Emscripten and WASI have no home directory and cannot provide :pep:`370`
+user site directory.
More information about the Python-checkins
mailing list