Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-41627: Distinguish 32 and 64-bit user site packages on Windows #22098

Merged
merged 3 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-41627: Distinguish 32 and 64-bit user site packages on Windows
  • Loading branch information
zooba committed Sep 4, 2020
commit 889d729422ec0bd4e1dd8a5016033410c2d26a5e
3 changes: 2 additions & 1 deletion Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ def _get_path(userbase):
version = sys.version_info

if os.name == 'nt':
return f'{userbase}\\Python{version[0]}{version[1]}\\site-packages'
ver_nodot = sys.winver.replace('.', '')
return f'{userbase}\\Python{ver_nodot}\\site-packages'

if sys.platform == 'darwin' and sys._framework:
return f'{userbase}/lib/python/site-packages'
Expand Down
15 changes: 8 additions & 7 deletions Lib/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
},
# NOTE: When modifying "purelib" scheme, update site._get_path() too.
'nt_user': {
'stdlib': '{userbase}/Python{py_version_nodot}',
'platstdlib': '{userbase}/Python{py_version_nodot}',
'purelib': '{userbase}/Python{py_version_nodot}/site-packages',
'platlib': '{userbase}/Python{py_version_nodot}/site-packages',
'include': '{userbase}/Python{py_version_nodot}/Include',
'scripts': '{userbase}/Python{py_version_nodot}/Scripts',
'stdlib': '{userbase}/Python{py_version_nodot_plat}',
'platstdlib': '{userbase}/Python{py_version_nodot_plat}',
'purelib': '{userbase}/Python{py_version_nodot_plat}/site-packages',
'platlib': '{userbase}/Python{py_version_nodot_plat}/site-packages',
'include': '{userbase}/Python{py_version_nodot_plat}/Include',
'scripts': '{userbase}/Python{py_version_nodot_plat}/Scripts',
'data': '{userbase}',
},
'posix_user': {
Expand Down Expand Up @@ -431,6 +431,8 @@ def _init_non_posix(vars):
vars['EXE'] = '.exe'
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
vars['TZPATH'] = ''
vars['py_version_nodot_plat'] = sys.winver.replace('.', '')

#
# public APIs
Expand Down Expand Up @@ -546,7 +548,6 @@ def get_config_vars(*args):

if os.name == 'nt':
_init_non_posix(_CONFIG_VARS)
_CONFIG_VARS['TZPATH'] = ''
if os.name == 'posix':
_init_posix(_CONFIG_VARS)
# For backward compatibility, see issue19555
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The user site directory for 32-bit now includes a ``-32`` suffix to
distinguish it from the 64-bit interpreter's directory.