Print checking swallows writes to explicit output streams
評価
調査の方向性
Start with the print interceptor that EvalExample.run_print_check() uses, and check how it handles the file keyword argument. Linked pull request #97 already targets this, so review its diff and discussion before writing anything. Done means the StringIO example from the issue passes, the stdout controls still pass, and the existing test suite stays green.
索引モデルが issue の本文から書いたものです。
説明
Reproduced on main at df945f7043cb8c456359b01700f3d664d30fbe44.
The print interceptor captures every call, including print(..., file=buffer). The destination never receives the text, so otherwise valid examples that use StringIO or another explicit text stream can fail their assertions.
from io import StringIO
buffer = StringIO()
print('hello', 'world', sep=':', end='!', file=buffer, flush=True)
assert buffer.getvalue() == 'hello:world!'
Run this through EvalExample.run_print_check(). The assertion fails because the buffer is empty.
Expected: checking/updating output preserves valid Python print semantics and produces compilable source.
Contract: https://docs.python.org/3/library/functions.html#print
The explicit-stream regression fails before the fix, while two stdout controls pass. All three pass afterward. The independently checked full local suite passes 84 tests with one expected failure and the known Windows object-address case deselected.
Relevant current and closed PR patches and issue discussions were checked; this does not duplicate the existing object-address, set-output, control-flow, metadata or indentation fixes.
- 主要言語
- Python
- スター
- 181
- フォーク
- 31
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pydantic/pytest-examples のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
pydantic/pytest-examples#102 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pydantic/pytest-examples#87 ·
-
Clean up Needed対応中かも @Danipulok が 86 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
pydantic/pytest-examples#72 · コメント 5 件 ·
-
Updating multiline output can insert invalid Python quote delimiters対応中かも @vinsymoyya が 13 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 45/100
pydantic/pytest-examples#98 · コメント 1 件 ·
-
Inline backticks truncate fenced Python examples対応中かも @vinsymoyya が 13 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
pydantic/pytest-examples#94 · コメント 1 件 ·
pydantic/pytest-examples の issue をすべて見る
似ている issue
-
triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
kornia/kornia-rs#1416 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
PolicyEngine/ai-inequality#64 ·
メンテナーはふだん 1 日以内に返信
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over time対応中かも @PabloRoque が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
pymc-devs/pymc-extras#839 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信