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
Steps to reproduce: Make some keyboard inputs while bpython is executing some code.
Actual behavior: Crash, wth a nice error message
Expected behavior: Begin interpreting the key presses only after the code has finished executing. Or something.
Minimal reproducing example:
Start bpython
Define a function that takes some time to compute. The bug seems to depend on actual execution. time.sleep does not trigger the bug.
Call it normally, and immediately after pressing enter, press up, enter, enter.
After a few seconds, the expected output of the first invocation appears, and an empty prompt. From the CPU usage it seems that the second invocation is now running, but the invocation command does not appear on the console
After another few seconds, observe the error message.
$ bpython3
bpython version 0.16 on top of Python 3.5.3 /usr/bin/python3
>>> def foo():
... return sum(x ** 0.5 - x ** 0.1 for x in range(10000000))
...
>>> foo()
21036287013.578144
>>>
Traceback (most recent call last):
File "/usr/bin/bpython3", line 11, in <module>
load_entry_point('bpython==0.16', 'console_scripts', 'bpython')()
File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 190, in main
exit_value = repl.mainloop()
File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 125, in mainloop
self.process_event_and_paint(e)
File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 89, in process_event_and_paint
self.process_event(e)
File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 580, in process_event
return self.process_control_event(e)
File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 616, in process_control_event
self.process_event(ee)
File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 584, in process_event
return self.process_key_event(e)
File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 711, in process_key_event
self.on_enter()
File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 794, in on_enter
self.push(self.current_line, insert_into_history=insert_into_history)
File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 1057, in push
self.coderunner.load_code(code_to_run)
File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/coderunner.py", line 113, in load_code
assert self.source is None, "you shouldn't load code when some is " \
AssertionError: you shouldn't load code when some is already running
[$? = 1]
For comparison, the built-in interpreter of python3 seems to behave like I would have expected, that is: only begin interpretation of the "up arrow" key once the previous command has finished.
The text was updated successfully, but these errors were encountered:
Steps to reproduce: Make some keyboard inputs while bpython is executing some code.
Actual behavior: Crash, wth a nice error message
Expected behavior: Begin interpreting the key presses only after the code has finished executing. Or something.
Minimal reproducing example:
time.sleep
does not trigger the bug.For comparison, the built-in interpreter of python3 seems to behave like I would have expected, that is: only begin interpretation of the "up arrow" key once the previous command has finished.
The text was updated successfully, but these errors were encountered: