gh-145492: Fix test_repr_recursive_factory reproducer by mvanhorn · Pull Request #145761 · python/cpython · GitHub
Skip to content

gh-145492: Fix test_repr_recursive_factory reproducer - #145761

Closed
mvanhorn wants to merge 1 commit into
python:mainfrom
mvanhorn:fix/145492-test-repr-reproducer
Closed

mvanhorn wants to merge 1 commit into
python:mainfrom
mvanhorn:fix/145492-test-repr-reproducer

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

The test's ProblematicFactory.__repr__ called repr(dd) but discarded the result, returning a fixed string instead. This didn't properly exercise the infinite recursion path from the original issue where repr(dd) is embedded in the return value.

Changed to return f"ProblematicFactory for {repr(dd)}" to match the original reproducer from gh-145492.

Happy to close this if @KowalskiThomas wants to submit the fix-up instead.

The test's ProblematicFactory.__repr__ called repr(dd) but discarded the
result, returning a fixed string instead. This didn't properly exercise
the infinite recursion path from the original issue where repr(dd) is
embedded in the return value.

Use `return f"ProblematicFactory for {repr(dd)}"` to match the original
reproducer from pythongh-145492.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@StanFromIreland

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants