-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Drop readline workaround introduced in #1281 #8848
Drop readline workaround introduced in #1281 #8848
Conversation
As commented in #8847 (comment):
Fair enough, what do you propose? A warning in Python <=3.9, and skipping it altogether in Python 3.10? |
Depends on what happens when pdb is invoked on Windows 3.10 with pyreadline installed. If our workaround breaks things (via pyreadline) then skip it; if things are broken anyways (because pdb imports readline), then we might as well keep it as-is. To me this seems similar to what'd happen if someone created, say, a custom |
IIUC it breaks in Python 3.10 with:
(As per #8733 (comment)).
That was the rationale; and given the workaround was done in 2015 and it was not clear if it was reported in Python 2, it might be the case that dropping it completely is OK. What do you think? |
Hm, I see - so with Python 3.10 we'd break pytest entirely if How does Don't really have a strong opinion on this either way, though. |
That's described in #1281, however I don't recall experiencing the problem myself. |
Let's disable the workaround on py 3.10 and schedule the removal to pytest 8 |
Do we issue a warning for Python <3.9? If so, what should the warning say? |
If pyreadline is involved we should give a hint, im not sure about the exact message |
Currently pyreadline is involved indirectly: Traceback (most recent call last):
...
File "d:\a\gstore\gstore\.venv\lib\site-packages\_pytest\capture.py", line 90, in _readline_workaround
import readline # noqa: F401
File "d:\a\gstore\gstore\.venv\lib\site-packages\readline.py", line 34, in <module>
rl = Readline()
File "d:\a\gstore\gstore\.venv\lib\site-packages\pyreadline\rlmain.py", line 422, in __init__
BaseReadline.__init__(self)
File "d:\a\gstore\gstore\.venv\lib\site-packages\pyreadline\rlmain.py", line 62, in __init__
mode.init_editing_mode(None)
File "d:\a\gstore\gstore\.venv\lib\site-packages\pyreadline\modes\emacs.py", line 633, in init_editing_mode
self._bind_key('space', self.self_insert)
File "d:\a\gstore\gstore\.venv\lib\site-packages\pyreadline\modes\basemode.py", line 162, in _bind_key
if not callable(func):
File "d:\a\gstore\gstore\.venv\lib\site-packages\pyreadline\py3k_compat.py", line 8, in callable
return isinstance(x, collections.Callable)
AttributeError: module 'collections' has no attribute 'Callable' We import |
Hi folks, sorry for the delay here. Not sure how to proceed... I agree about dropping this for Python 3.10, however what should the warning say for Python<3.9 users? Note that we can't reasonably "warn" or suggest about anything, if we import
But that doesn't seems really helpful or actionable. |
Gentle ping here. How should we proceed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #8847 (comment), this PR LGTM.
36f3058
to
6264720
Compare
Given that this is long done, approved and a breaking change, let's sneak it into 7.0.0. |
We had a very similar workaround before for pyreadline, which had a similar issue: - Introduced in pytest-dev#1281 - Removed in pytest-dev#8848 for pytest-dev#8733 and pytest-dev#8847 This technically will regress the issues above, but those issues just mean that `import readline` is broken in general, so the user should fix it instead (by e.g. uninstalling pyreadline). Fixes pytest-dev#12888 Fixes pytest-dev#13170
* Add readline workaround for libedit We had a very similar workaround before for pyreadline, which had a similar issue: - Introduced in #1281 - Removed in #8848 for #8733 and #8847 This technically will regress the issues above, but those issues just mean that `import readline` is broken in general, so the user should fix it instead (by e.g. uninstalling pyreadline). Fixes #12888 Fixes #13170 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Handle no readline on Windows --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add readline workaround for libedit We had a very similar workaround before for pyreadline, which had a similar issue: - Introduced in #1281 - Removed in #8848 for #8733 and #8847 This technically will regress the issues above, but those issues just mean that `import readline` is broken in general, so the user should fix it instead (by e.g. uninstalling pyreadline). Fixes #12888 Fixes #13170 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Handle no readline on Windows --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit b4009b3)
* Add readline workaround for libedit We had a very similar workaround before for pyreadline, which had a similar issue: - Introduced in #1281 - Removed in #8848 for #8733 and #8847 This technically will regress the issues above, but those issues just mean that `import readline` is broken in general, so the user should fix it instead (by e.g. uninstalling pyreadline). Fixes #12888 Fixes #13170 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Handle no readline on Windows --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit b4009b3)
Fix #8733
Closes #8847