Title: ipdb and "--simple-prompt" leads to an eventloop crash · Issue #10577 · ipython/ipython · GitHub
Open Graph Title: ipdb and "--simple-prompt" leads to an eventloop crash · Issue #10577 · ipython/ipython
X Title: ipdb and "--simple-prompt" leads to an eventloop crash · Issue #10577 · ipython/ipython
Description: Hi, It does not appear to be currently possible to use the IPython debugger in conjunction with the simple-prompt mode and ipdb (from pypi : pip install ipdb). This makes debugging multithreaded applications with ipdb and Emacs impossibl...
Open Graph Description: Hi, It does not appear to be currently possible to use the IPython debugger in conjunction with the simple-prompt mode and ipdb (from pypi : pip install ipdb). This makes debugging multithreaded ap...
X Description: Hi, It does not appear to be currently possible to use the IPython debugger in conjunction with the simple-prompt mode and ipdb (from pypi : pip install ipdb). This makes debugging multithreaded ap...
Opengraph URL: https://github.com/ipython/ipython/issues/10577
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ipdb and \"--simple-prompt\" leads to an eventloop crash","articleBody":"Hi,\r\n\r\nIt does not appear to be currently possible to use the IPython debugger in conjunction with the simple-prompt mode and ipdb (from pypi : `pip install ipdb`).\r\n\r\nThis makes debugging multithreaded applications with ipdb and Emacs impossible (since the only way to break in the right thread is to put the snippet: `import ipdb; ipdb.set_trace()` in the code.\r\n\r\nIf I remove the \"--simple-prompt\" option then I get garbled text such as \"^[[6n^[[Jipdb\u003e ^[[6D^[[6C\" at the ipdb prompt in Emacs since this is a dumb terminal which doesn't understand the special character escapes sent back by prompt_toolkit.\r\n\r\nThe traceback returned when using \"--simple-prompt\" is :\r\n````\r\n [...]\r\n File \"some_file.py\", line 30, in some_function\r\n import ipdb; ipdb.set_trace()\r\n File \"/home/maxim/.virtualenvs/project1/local/lib/python2.7/site-packages/ipdb/__main__.py\", line 97, in set_trace\r\n p = _init_pdb(context).set_trace(frame)\r\n File \"/home/maxim/.virtualenvs/project1/local/lib/python2.7/site-packages/ipdb/__main__.py\", line 77, in _init_pdb\r\n p = debugger_cls(def_colors, context=context)\r\n File \"/home/maxim/.virtualenvs/project1/local/lib/python2.7/site-packages/IPython/terminal/debugger.py\", line 26, in __init__\r\n self.pt_init()\r\n File \"/home/maxim/.virtualenvs/project1/local/lib/python2.7/site-packages/IPython/terminal/debugger.py\", line 68, in pt_init\r\n self.pt_cli = CommandLineInterface(self._pt_app, eventloop=self.shell._eventloop)\r\nAttributeError: 'TerminalInteractiveShell' object has no attribute '_eventloop'\r\n````\r\n\r\nIt should be trivial to reproduce. Make sure you have `ipdb` installed (`pip install ipdb`).\r\n\r\n1. Create a script such as the following to a file named \"ipdb_eventloop_repro.py\":\r\n\r\n````\r\nprint 'hello'\r\nprint ''\r\nimport ipdb; ipdb.set_trace()\r\nprint 'world'\r\n````\r\n2. In a terminal, start the IPython process in 'simple-prompt' mode like this:\r\n\r\n`ipython --simple-prompt -c \"%run -d ipdb_eventloop_repro.py\"`\r\n\r\n3. Then press 'c' to trigger the crash.\r\n\r\nI'm not sure where the fix should happen: in IPython, or in ipdb? There was an attempt at fixing it on the ipdb side here: https://github.com/gotcha/ipdb/pull/130 but it causes spewing to restart in the dumb shell since it relies on the prompt_toolkit eventloop.\r\n\r\nAny suggestion of a fix? I'd really like to get ipdb + Emacs going :)","author":{"url":"https://github.com/apteryks","@type":"Person","name":"apteryks"},"datePublished":"2017-05-19T22:00:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/10577/ipython/issues/10577"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:88240136-471b-96ec-319c-37fcf7120ddd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A66C:9609B:27FEDF6:398D385:6A4D236A |
| html-safe-nonce | 10fec19499b6e8194755dbb7940dff00a90f9962b2a90b3f75f9ed49fb10ff53 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjZDOjk2MDlCOjI3RkVERjY6Mzk4RDM4NTo2QTREMjM2QSIsInZpc2l0b3JfaWQiOiIzMzk4MTY5MDcyNTg3NTgwMjY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ac46c02917dabc400127ead198bde41792aba2315fe49ff84901051811098a11 |
| hovercard-subject-tag | issue:230100291 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ipython/ipython/10577/issue_layout |
| twitter:image | https://opengraph.githubassets.com/887ead78b7077c2b31024531b3a97a25d91ff871aa0b93985d5ac78560992725/ipython/ipython/issues/10577 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/887ead78b7077c2b31024531b3a97a25d91ff871aa0b93985d5ac78560992725/ipython/ipython/issues/10577 |
| og:image:alt | Hi, It does not appear to be currently possible to use the IPython debugger in conjunction with the simple-prompt mode and ipdb (from pypi : pip install ipdb). This makes debugging multithreaded ap... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | apteryks |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/ipython/ipython git https://github.com/ipython/ipython.git |
| octolytics-dimension-user_id | 230453 |
| octolytics-dimension-user_login | ipython |
| octolytics-dimension-repository_id | 658518 |
| octolytics-dimension-repository_nwo | ipython/ipython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 658518 |
| octolytics-dimension-repository_network_root_nwo | ipython/ipython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 93f17a978ee60bc4668e1d7b90e6bd2d622261fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width