]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-90473: disable user site packages on WASI/Emscripten (GH-93633)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 9 Jun 2022 16:12:51 +0000 (09:12 -0700)
committerGitHub <noreply@github.com>
Thu, 9 Jun 2022 16:12:51 +0000 (09:12 -0700)
(cherry picked from commit 5a4af3ab030a3f3e708ee83d7d4ca3cb2d5b7360)

Co-authored-by: Christian Heimes <christian@python.org>
Lib/site.py
Lib/sysconfig.py
Misc/NEWS.d/next/Library/2022-06-09-10-12-55.gh-issue-90473.683m_C.rst [new file with mode: 0644]

index b11cd48e69e9a86350cbd67d1eac0b6328adcbfd..69670d9d7f22300c8694528c44594b6328888d1f 100644 (file)
@@ -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):
index e21b7303fecc6b8fc507f4a66dd960cd3f2fc2fc..bf926cf76807b7af7708b8f8fe86f4a90b360805 100644 (file)
@@ -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 (file)
index 0000000..b053a8e
--- /dev/null
@@ -0,0 +1,2 @@
+Emscripten and WASI have no home directory and cannot provide :pep:`370`
+user site directory.