[New-bugs-announce] [issue45623] static build is broken

egorpugin report at bugs.python.org
Wed Oct 27 06:30:32 EDT 2021


New submission from egorpugin <egor.pugin at gmail.com>:

Static build is not working any more since 3.10.

'winver' member is only defined with dll build.

See master - 'winver' call which is not available for windows+static build.
https://github.com/python/cpython/blob/main/Lib/site.py#L292

See 3.9 file - no 'winver' call.
https://github.com/python/cpython/blob/1016ef37904c7ddc16fb18d3369b2a78cf428fa4/Lib/site.py#L266

Error:
```
1>EXEC : Fatal Python error : init_import_site: Failed to import the site module
1>Python runtime state: initialized
1>Traceback (most recent call last):
1>  File "D:\dev\swst\pkg\8b\0a\10a9\src\sdir\Lib\site.py", line 657, in <module>
1>    main()
1>  File "D:\dev\swst\pkg\8b\0a\10a9\src\sdir\Lib\site.py", line 643, in main
1>    known_paths = addusersitepackages(known_paths)
1>  File "D:\dev\swst\pkg\8b\0a\10a9\src\sdir\Lib\site.py", line 380, in addusersitepackages
1>    user_site = getusersitepackages()
1>  File "D:\dev\swst\pkg\8b\0a\10a9\src\sdir\Lib\site.py", line 367, in getusersitepackages
1>    USER_SITE = _get_path(userbase)
1>  File "D:\dev\swst\pkg\8b\0a\10a9\src\sdir\Lib\site.py", line 332, in _get_path
1>    ver_nodot = sys.winver.replace('.', '')
1>AttributeError: module 'sys' has no attribute 'winver'
```

----------
messages: 405082
nosy: egorpugin
priority: normal
severity: normal
status: open
title: static build is broken
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45623>
_______________________________________


More information about the New-bugs-announce mailing list