{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/11266","repository_url":"https://api.github.com/repos/ipython/ipython","labels_url":"https://api.github.com/repos/ipython/ipython/issues/11266/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/11266/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/11266/events","html_url":"https://github.com/ipython/ipython/pull/11266","id":351012642,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NzE1NzUz","number":11266,"title":"Fix `up` through generators in postmortem debugger; closes #6251","user":{"login":"rhelmot","id":2498805,"node_id":"MDQ6VXNlcjI0OTg4MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/2498805?v=4","gravatar_id":"","url":"https://api.github.com/users/rhelmot","html_url":"https://github.com/rhelmot","followers_url":"https://api.github.com/users/rhelmot/followers","following_url":"https://api.github.com/users/rhelmot/following{/other_user}","gists_url":"https://api.github.com/users/rhelmot/gists{/gist_id}","starred_url":"https://api.github.com/users/rhelmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhelmot/subscriptions","organizations_url":"https://api.github.com/users/rhelmot/orgs","repos_url":"https://api.github.com/users/rhelmot/repos","events_url":"https://api.github.com/users/rhelmot/events{/privacy}","received_events_url":"https://api.github.com/users/rhelmot/received_events","type":"User","site_admin":false},"labels":[{"id":462276554,"node_id":"MDU6TGFiZWw0NjIyNzY1NTQ=","url":"https://api.github.com/repos/ipython/ipython/labels/help%20wanted","name":"help wanted","color":"0e8a16","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ipython/ipython/milestones/59","html_url":"https://github.com/ipython/ipython/milestone/59","labels_url":"https://api.github.com/repos/ipython/ipython/milestones/59/labels","id":3639252,"node_id":"MDk6TWlsZXN0b25lMzYzOTI1Mg==","number":59,"title":"7.1","description":"","creator":{"login":"Carreau","id":335567,"node_id":"MDQ6VXNlcjMzNTU2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/335567?v=4","gravatar_id":"","url":"https://api.github.com/users/Carreau","html_url":"https://github.com/Carreau","followers_url":"https://api.github.com/users/Carreau/followers","following_url":"https://api.github.com/users/Carreau/following{/other_user}","gists_url":"https://api.github.com/users/Carreau/gists{/gist_id}","starred_url":"https://api.github.com/users/Carreau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carreau/subscriptions","organizations_url":"https://api.github.com/users/Carreau/orgs","repos_url":"https://api.github.com/users/Carreau/repos","events_url":"https://api.github.com/users/Carreau/events{/privacy}","received_events_url":"https://api.github.com/users/Carreau/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2018-09-10T13:18:08Z","updated_at":"2018-09-16T16:01:36Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2018-08-16T00:24:03Z","updated_at":"2018-09-18T03:00:19Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ipython/ipython/pulls/11266","html_url":"https://github.com/ipython/ipython/pull/11266","diff_url":"https://github.com/ipython/ipython/pull/11266.diff","patch_url":"https://github.com/ipython/ipython/pull/11266.patch"},"body":"By passing the lowest traceback element into the debugger, we require it to use frame.f_back to find older frames. However, [f_back is always None for generator frames in the postmortem context](https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Objects/genobject.c#L226-L230). By providing a higher-up traceback element, pdb can traverse down the traceback.tb_next links, which do work correctly across generator calls.\r\n\r\n...or at least, that's my understanding of the situation after spending half an hour researching the issue. This fix seems to work for my use cases, but I don't really understand the depths of pdb and can't tell if this may cause adverse affects elsewhere.\r\n\r\n(I would also love to write a test for this, but I have no idea if we can or want to drive the debugger automatically for tests?)"},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/422237923","html_url":"https://github.com/ipython/ipython/pull/11266#issuecomment-422237923","issue_url":"https://api.github.com/repos/ipython/ipython/issues/11266","id":422237923,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjIzNzkyMw==","user":{"login":"rhelmot","id":2498805,"node_id":"MDQ6VXNlcjI0OTg4MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/2498805?v=4","gravatar_id":"","url":"https://api.github.com/users/rhelmot","html_url":"https://github.com/rhelmot","followers_url":"https://api.github.com/users/rhelmot/followers","following_url":"https://api.github.com/users/rhelmot/following{/other_user}","gists_url":"https://api.github.com/users/rhelmot/gists{/gist_id}","starred_url":"https://api.github.com/users/rhelmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhelmot/subscriptions","organizations_url":"https://api.github.com/users/rhelmot/orgs","repos_url":"https://api.github.com/users/rhelmot/repos","events_url":"https://api.github.com/users/rhelmot/events{/privacy}","received_events_url":"https://api.github.com/users/rhelmot/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T03:00:19Z","updated_at":"2018-09-18T03:00:19Z","author_association":"NONE","body":"Okay, I read the pdb/bdb source more carefully and force pushed what should be a real fix. Explanation in the commit message.\r\n\r\nThe takeaway here for future reference is that the only place the frame passed into `interaction` is used is in `Bdb.get_stack`, which walks the stack backwards from the frame and forwards from the traceback to construct the full list of stack frames. The frame can be None and this will still work, but if the traceback and frame don't correspond to the same frame, it will duplicate parts of the stack."}}
{"actor":{"display_login":"rhelmot"}}