Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent readline from bugging out when the editline backend is used #12961

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Viicos
Copy link

@Viicos Viicos commented Nov 14, 2024

Fixes #12888.

Seems like having readline (or rlcompleter, which imports readline) imported at the root of the pdb module (as it is on 3.13) introduces the issue, but I'm not sure why. Perhaps the libedit backend tries to read something from stdin on startup? (Because running pytest -s works).

@The-Compiler
Copy link
Member

Previous history:

It would probably reintroduce the pyreadline breakage, but that seems fine to me, as that's just a broken and ancient setup at this point.

@Viicos
Copy link
Author

Viicos commented Nov 14, 2024

It would probably reintroduce the pyreadline breakage, but that seems fine to me, as that's just a broken and ancient setup at this point.

Yeah I was thinking the same. We shouldn't expect pyreadline to be installed on any user environment :).

Should we investigate on why we get this failure with the editline backend and update the docstring?

@The-Compiler
Copy link
Member

It might be worth having a minimal reproducer so this could be reported to CPython or libedit - other than that, if the workaround works, I think it's fine to use it as-is and close the issue with it. Seems harmless enough to me.

``editline`` (``libedit``) backend is used.
Since Python 3.13, :mod:`readline` is imported at the root of the
:mod:`pdb` module, as a side effect of importing :mod:`rlcompleter`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:mod:`pdb` module, as a side effect of importing :mod:`rlcompleter`.
:mod:`pdb` module, as a side effect of importing :mod:`rlcompleter`.
See #12888 for details.

@nicoddemus
Copy link
Member

I'm also fine with the workaround as is if a test is not feasible.

Other than that we would need a changelog entry.

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.

pdb prompt is nonresponsive in Python 3.13.0 from python-build-standalone
3 participants