`sys._base_executable` in framework builds does not take into account ABI build flag
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
For 3.13.0, we now provide separate Python.framework and PythonT.framework builds with the python.org macOS installer in an attempt to keep the two installed variants as independent as possible while the free-treading feature is classified as experimental. One goal of this is to ensure that there are no duplicate file names in the two framework bin directories, ending up with i.e. python3.13 in one and python3.13t in the other.
Unfortunately, it was discovered that removing python3.13 in the PythonT.framework bin directory breaks venv support. The root cause is the code that was added to Modules/getpath.py by #31958 which fixed another problem with framework venv support by setting sys._base_executable (which venv uses) to:
base_executable = f"{dirname(library)}/bin/python{VERSION_MAJOR}.{VERSION_MINOR}"
Note that this path does not take into account the ABI build tag, meaning that any framework builds using a configuration option that appends a non-blank ABI, like --disable-gil -> t or --with-pydebug -> d or both (td) needs to keep a non-suffixed python3.x in its framework bin directory for venv executions to work. And that can cause unnoticed ambiguities if users add both framework bin directories to a shell PATH which could be expected to be a common occurrence.
For 3.13.0, we handwave around the problem in the macOS installer by leaving an unsuffixed python3.13 in the PythonT.framework bin directory and by not supporting the free-threaded variant in the Update Shell Profile.command and installer post-installation script. But it should be fixed and, if possible, in a way that does not break existing virtual environments.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず Modules/getpath.py と framework のパスロジックを読み、venv が sys._base_executable をどのように使用するかを追跡します。通常の framework ビルドと ABI サフィックス付きの framework ビルドを比較し、その後、既存の仮想環境と Python.framework/PythonT.framework の異なる bin 名が引き続き使用可能であることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend, operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100