Updating multiline output can insert invalid Python quote delimiters
評価
調査の方向性
The payload names run_print_update() and example.source but not the file that writes printed output back into examples, so search for run_print_update first. Reproduce with an example whose print output contains a triple-quote delimiter, in both the Markdown and Python-docstring variants. Done means example.source compiles after the update in both cases, and the output still matches the printed text.
索引モデルが issue の本文から書いたものです。
説明
Reproduced on main at df945f7043cb8c456359b01700f3d664d30fbe44.
Multiline printed text is inserted between triple-quote delimiters without checking whether the text contains the chosen delimiter. An example printing a line of three double quotes in Markdown, or three single quotes in a Python docstring example, produces an early-closed or unterminated string after output updating.
With --update-examples enabled, update an example whose print output is first line, then the chosen triple-quote delimiter, then last line. Compile example.source after run_print_update(): it raises SyntaxError. Both Markdown and Python-docstring delimiter variants reproduce.
Expected: checking/updating output preserves valid Python print semantics and produces compilable source.
Contract: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
Both delimiter regressions fail before the fix and pass afterward. The independently checked full local suite passes 83 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 件 ·
-
Print checking swallows writes to explicit output streams対応中かも @vinsymoyya が 13 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 22/100
pydantic/pytest-examples#96 · コメント 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 日以内に返信