`sysconfig` provide wrong path in built cpython on windows

Aperta
#160,905 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
build-system

Direzione di ricerca

Read _init_non_posix in Lib/sysconfig/__init__.py around line 412 and check how LIBDIR is computed for Windows Python builds. Compare that value with the directory containing sys.executable; done when the build case reports the expected path and the relevant sysconfig tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

OS-windows stdlib type-bug
Bug report

I'm sure that in _init_non_posix this will be wrong when in python build:

https://github.com/python/cpython/blob/main/Lib/sysconfig/__init__.py#L412

In python build, this value is just the folder where the sys.executable in. Change it to:

    if not _PYTHON_BUILD:
        vars['LIBDIR'] = _safe_realpath(os.path.join(get_config_var('installed_base'), 'libs'))
    else:
        vars['LIBDIR'] = os.path.dirname(
            _safe_realpath(sys.executable)
        )
CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs
  • gh-160906
Lingua principale
Python
Stelle
77.8k
Fork
37.7k
Merge medio
17h 2m
PR unite (30g)
699

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python/cpython

Tutte le issue di python/cpython

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.