Skip to content

Fix bare ... doctest terminators in replay scripts#8

Merged
chrizzFTD merged 4 commits into
mainfrom
cursor/fix-doctest-terminators-28e5
Jun 27, 2026
Merged

Fix bare ... doctest terminators in replay scripts#8
chrizzFTD merged 4 commits into
mainfrom
cursor/fix-doctest-terminators-28e5

Conversation

@chrizzFTD

Copy link
Copy Markdown
Owner

Summary

Fixes #7 — bare ... doctest block terminators were preserved as Python Ellipsis in generated replay scripts, causing SyntaxError during interactive replay.

Changes

  • strip_doctest_prompts() now drops:
    • bare ... lines (doctest block terminators)
    • ... prompts followed only by whitespace (e.g. ... )
  • Continuation prompts with code (... x = 1) and explicit >>> ... ellipsis usage are unchanged.
  • Tests: unit tests for strip_doctest_prompts() plus a full-build integration test.
  • Docs: extended the existing Replay session example in docs/example.rst with a multi-line class definition using standard doctest formatting.

Verification

  • python3 -m pytest . — 11 passed
  • sphinx-build docs docs/_build — succeeded; generated replay script omits bare ...
Open in Web Open in Cursor 

strip_doctest_prompts() now drops bare '...' lines and '...' prompts
followed only by whitespace, which are doctest block terminators with no
Python semantics. Continuation prompts with code and explicit '>>> ...'
ellipsis usage are unchanged.

Adds unit and integration tests, and extends the Replay session docs
example with a multi-line class definition.

Fixes #7

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
@read-the-docs-community

read-the-docs-community Bot commented Jun 27, 2026

Copy link
Copy Markdown

Documentation build overview

📚 sphinx-pyrepl-web | 🛠️ Build #33336141 | 📁 Comparing f23c84a against latest (e8cf8cd)

  🔍 Preview build  

2 files changed
± example.html
± index.html

cursoragent and others added 3 commits June 27, 2026 11:14
A bare '...' marks the end of a multi-line REPL input block. Dropping it
entirely caused the next statement to be parsed as a continuation, e.g.
'Foo()' after a class definition. Emit a blank line instead of Ellipsis
or nothing.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Bump version, add CHANGELOG, and add PyPI publish workflow triggered by
GitHub releases.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
@chrizzFTD
chrizzFTD merged commit ef2ee2b into main Jun 27, 2026
4 checks passed
@chrizzFTD
chrizzFTD deleted the cursor/fix-doctest-terminators-28e5 branch June 27, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

strip_doctest_prompts should skip bare ... doctest block terminators

2 participants