Sisyphus repository
Last update: 21 october 2019 | SRPMs: 17508 | Visits: 15328982
en ru br
ALT Linux repos
S:16.7.6-alt1
5.0: 1.3.3-alt1

Group :: Development/Python
RPM: python-module-virtualenv

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: python3-system-sys.path.patch
Download


From 29a76ce38918861aeefe016f430288d3032d5dba Mon Sep 17 00:00:00 2001
From: Stanislav Levin <slev@altlinux.org>
Date: Thu, 29 Mar 2018 22:10:33 +0300
Subject: [PATCH] Fix python3 sys.path in virtualenv
Based on the original patch from nbr@.
During virtualenv initialization the noarch system site-packages
directory only is added to sys.path. This leads to import errors of
arch dependent modules while the system-site-packages feature is used.
---
 virtualenv/virtualenv_embedded/site.py | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/virtualenv/virtualenv_embedded/site.py b/virtualenv/virtualenv_embedded/site.py
index 7969769..f603896 100644
--- a/virtualenv/virtualenv_embedded/site.py
+++ b/virtualenv/virtualenv_embedded/site.py
@@ -237,6 +237,14 @@ def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_pre
                             os.path.join(prefix, "lib", "site-python"),
                             os.path.join(prefix, "python" + sys.version[:3], "lib-dynload")]
                 lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages")
+                if sys.version_info > (3, 0):
+                    # path to noarch python3 modules
+                    sitedirs[0] = os.path.join(prefix,
+                                         "lib",
+                                         "python" + sys.version[:1],
+                                         "site-packages")
+                    # path to arch dependent python3 modules
+                    lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:1], "site-packages")
                 if (os.path.exists(lib64_dir) and
                     os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]):
                     if _is_64bit:
-- 
2.10.4
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin