python / python/cpython

PYTHONDONTWRITEBYTECODE documentation is incorrect

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

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

docs
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Documentation

PYTHONDONTWRITEBYTECODE is documented in Doc/using/cmdline.rst as:

If this is set to a non-empty string, Python won't try to write .pyc files on the import of source modules.

This is incorrect. The variable is obtained in Python/initconfig.c as:

    int dont_write_bytecode = 0;
    _Py_get_env_flag(use_env, &dont_write_bytecode, "PYTHONDONTWRITEBYTECODE");
    if (dont_write_bytecode) {
        config->write_bytecode = 0;
    }

and _Py_get_env_flag reads the environment variable value as integer, treating non-integer string as 1. Specifically, this means that PYTHONDONTWRITEBYTECODE=0 will not suppress writing .pyc files, even though the environment variable is assigned a non-empty string "0".

Linked PRs
  • gh-143144

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

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

はじめの一歩

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

調査の方向性

Doc/using/cmdline.rst から始め、文書化された動作を Python/initconfig.c と比較します。特に、issue に示されている _Py_get_env_flag 呼び出しを確認してください。環境変数の説明を更新し、整数の解析と PYTHONDONTWRITEBYTECODE=0 の動作が正確になるようにします。文言が実装と一致すれば、ドキュメントは完了です。

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

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

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

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