You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thanks for bpython, I love it's versatility and ability to make sensible suggestions and show documentation on-the-fly.
One of my use-cases is using it alternatingly with the shell (e.g. bash), and switching with Ctrl-Z (SIGSTOP) and fg (shell-builtin to foreground bpython again).
This use-case became broken at some point.
Steps to reproduce:
Open a Terminal, e.g. xfce4-terminal 0.8.10 (shouldn't matter though), with some shell, e.g. bash 5.1.12(1)-release (shouldn't matter though)
Start bpython (I'm using 0.22.1 with Python 3.9.9, according to bpython)
Press Ctrl-Z (for some reason, SIGSTOP works as intended, and does not cause a crash.)
Expected behavior:
bash$ bpythonbpython Version 0.22.1 mit Python 3.9.9 /usr/bin/python3>>> [2]+ Angehalten bpython[$? = 147]bash$ jobs[1]+ Angehalten bpythonbash$
Actual behavior:
bash$ bpythonbpython Version 0.22.1 mit Python 3.9.9 /usr/bin/python3>>> ^ZTraceback (most recent call last): File "/usr/bin/bpython", line 33, in <module> sys.exit(load_entry_point('bpython==0.22.1', 'console_scripts', 'bpython')()) File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 248, in main repl.mainloop(True, paste) File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 180, in mainloop for e in inputs: File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 261, in _combined_events e = event_provider.send(timeout) File "/usr/lib/python3/dist-packages/curtsies/input.py", line 212, in send return self._send(timeout) File "/usr/lib/python3/dist-packages/curtsies/input.py", line 264, in _send stdin_ready_for_read, event = self._wait_for_read_ready_or_timeout( File "/usr/lib/python3/dist-packages/curtsies/input.py", line 170, in _wait_for_read_ready_or_timeout (rs, _, _) = select.select( File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 613, in sigtstp_handler self.__exit__()TypeError: __exit__() missing 3 required positional arguments: 'exc_type', 'exc_val', and 'exc_tb'[$? = 1]bash$ jobsbash$
$ bpython
bpython version 0.23 on top of Python 3.8.10 /usr/bin/python3
>>>
CTRL-Z
[4]+ Stopped bpython
$ fg
Traceback (most recent call last):
File "/home/josh/.local/bin/bpython", line 8, in<module>sys.exit(main())
File "/home/josh/.local/lib/python3.8/site-packages/bpython/curtsies.py", line 248, in main
repl.mainloop(True, paste)
File "/home/josh/.local/lib/python3.8/site-packages/bpython/curtsies.py", line 180, in mainloop
forein inputs:
File "/home/josh/.local/lib/python3.8/site-packages/bpython/curtsies.py", line 261, in _combined_events
e = event_provider.send(timeout)
File "/home/josh/.local/lib/python3.8/site-packages/curtsies/input.py", line 238, in send
return self._send(timeout)
File "/home/josh/.local/lib/python3.8/site-packages/curtsies/input.py", line 290, in _send
stdin_ready_for_read, event = self._wait_for_read_ready_or_timeout(
File "/home/josh/.local/lib/python3.8/site-packages/curtsies/input.py", line 198, in _wait_for_read_ready_or_timeout
(rs, _, _) = select.select(
File "/home/josh/.local/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 662, in sigtstp_handler
self.after_suspend()
File "/home/josh/.local/lib/python3.8/site-packages/bpython/curtsies.py", line 132, in after_suspend
self.window.__enter__()
File "/home/josh/.local/lib/python3.8/site-packages/curtsies/window.py", line 287, in __enter__
self.cbreak.__enter__()
File "/usr/lib/python3.8/contextlib.py", line 111, in __enter__
del self.args, self.kwds, self.func
AttributeError: args
Activity
BenWiederhake commentedon Jan 8, 2022
Holy crap that was fast. Thank you!
joshnatis commentedon Oct 5, 2022
Hi, I can reproduce this again :-(
sebastinas commentedon Oct 5, 2022
This is a different issue. Please open a new bug.
joshnatis commentedon Oct 5, 2022
Alright sure thing, thanks @sebastinas
Fix call of __exit__ (fixes bpython#948)