Infinite loop when using ipdb on ipython 7.13+
See original GitHub issueI use pytest with appium and when I use ipdb.set_trace() I’m stuck in a loop:
Exception in thread Thread-21249:
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/Users/vverdeil/workspace/venv/testenv/lib/python3.7/site-packages/IPython/terminal/debugger.py", line 102, in in_thread
line = self.pt_app.prompt()
File "/Users/vverdeil/workspace/venv/testenv/lib/python3.7/site-packages/prompt_toolkit/shortcuts/prompt.py", line 986, in prompt
return self.app.run()
File "/Users/vverdeil/workspace/venv/testenv/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 788, in run
return get_event_loop().run_until_complete(self.run_async(pre_run=pre_run))
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'Thread-21249'.
As you can see I reached thread 21249 before managing to kill the process.
With the same code it works as expected on ipython 7.12, so I guess is it linked to https://github.com/ipython/ipython/pull/12141/
Am I the only one having this bug?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:7
Top Results From Across the Web
7.x Series — IPython 7.31.0 documentation
This should fix some issues/infinite loop, but let us know if you come across any regressions. In particular this fixes issues with kmaork/madbg, ......
Read more >Stuck in Ipython debugger loop [duplicate] - Stack Overflow
The main way I use to exit the loop is Ctrl + Z . Otherwise, it is also possible to execute: ipdb> import...
Read more >IPython Documentation
loops with Python's PyOS_InputHook API. A new command-line flag –gui controls GUI support, and it can also be enabled after IPython startup ...
Read more >Python Notes for Professionals
Section 7.1: Creating an enum (Python 2.4 through 3.3) ... Section 21.5: List Comprehensions with Nested Loops ... Section 103.1: Via IPython and...
Read more >Jupyter Lesson 9: How to Interrupt the Kernel (Stop code from ...
Every now and then you will run code that either runs forever (infinite loop) or has errors you identified and want to stop....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah i still into the same issue. Welcome back to pre ipdb times 😭
versions:
In the meantime
pdbpp
works.While trying to provide a simple script to reproduce I found out a fix: I had the the issue in an environment with prompt-toolkit==3.0.2 and it is resolve by prompt-toolkit==3.0.8.