python / python/cpython

sysconfig values for `platstdlib` do not appear to be accurate

オープン
#119,845 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

stdlib topic-sysconfig topic-venv type-bug
主要言語
Python
スター
77.2k
フォーク
36k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

The values set for platstdlib in the sysconfig scheme paths are not consistent with the way sys.path is configured in getpath.py

sysconfig: https://github.com/python/cpython/blob/main/Lib/sysconfig/__init__.py#L28
getpath: https://github.com/python/cpython/blob/main/Modules/getpath.py#L182

Given this appears to have been wrong essentially forever, it appears nobody is using platstdlib for anything important (even I only noticed because running -m sysconfig inside a venv reports a platstdlib path inside the venv, which is definitely not right).

Still, it should be possible to make them at least a bit more consistent with the way sys.path is actually initialised (appending lib-dynload to the stdlib path looks to be sufficient for non-Windows system, but I'm less sure on Windows)

CPython versions tested on:

3.12

Operating systems tested on:

Linux, Windows

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Lib/sysconfig/init.py#L28 と Modules/getpath.py#L182 を比較し、まず Linux と Windows で platstdlib がどのように形成されるかを確認する。仮想環境の内外で sys.path と python -m sysconfig を使って結果のパスを検証する;完了の条件は、両方のプラットフォームで platstdlib が実際の初期化を反映していることである。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。