Title: Debugger spuriously stops on exceptions when using python interpreter from a virtualenv · Issue #490 · microsoft/vscode-python · GitHub
Open Graph Title: Debugger spuriously stops on exceptions when using python interpreter from a virtualenv · Issue #490 · microsoft/vscode-python
X Title: Debugger spuriously stops on exceptions when using python interpreter from a virtualenv · Issue #490 · microsoft/vscode-python
Description: Environment data VS Code version: 1.19.1 Python Extension version: 0.9.1 Python Version: 2.7.14 OS and version: MacOs Sierra 10.12.6 Virtualenv version: 15.1.0 Actual behavior With breaking on Uncaught Exceptions option enabled, the debu...
Open Graph Description: Environment data VS Code version: 1.19.1 Python Extension version: 0.9.1 Python Version: 2.7.14 OS and version: MacOs Sierra 10.12.6 Virtualenv version: 15.1.0 Actual behavior With breaking on Unca...
X Description: Environment data VS Code version: 1.19.1 Python Extension version: 0.9.1 Python Version: 2.7.14 OS and version: MacOs Sierra 10.12.6 Virtualenv version: 15.1.0 Actual behavior With breaking on Unca...
Opengraph URL: https://github.com/microsoft/vscode-python/issues/490
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Debugger spuriously stops on exceptions when using python interpreter from a virtualenv","articleBody":"## Environment data\r\nVS Code version: 1.19.1\r\nPython Extension version: 0.9.1\r\nPython Version: 2.7.14\r\nOS and version: MacOs Sierra 10.12.6\r\nVirtualenv version: 15.1.0\r\n\r\n## Actual behavior\r\nWith breaking on `Uncaught Exceptions` option enabled, the debugger breaks inside `re` module when using python interpreter coming from a virtual environment created by virtualenv. Hitting `Continue` button has no end, it keeps breaking inside `re` module, that happens to be indirectly imported in the first line of my code, so I can't move forward with debugging without disabling the `Uncaught Exceptions` option.\r\nWhen using the same version of python interpreter, but installed globally, the debugger does not break inside `re` module, it progresses through the code and breaks on first uncaught exception in my code.\r\n\r\n## Expected behavior\r\nDebugger should behave the same way, no matter if I use virtualenv or system wide version of python.\r\n\r\n## Steps to reproduce: \r\n- Create and activate virtualenv\r\n```\r\nmbp:~$ virtualenv code/python-venvs/testenv\r\nNew python executable in /Users/leszek/code/python-venvs/testenv/bin/python2.7\r\nAlso creating executable in /Users/leszek/code/python-venvs/testenv/bin/python\r\nInstalling setuptools, pip, wheel...done.\r\n\r\n@mbp:~$ . code/python-venvs/testenv/bin/activate\r\n\r\n(testenv) @mbp:~$ which python\r\n/Users/leszek/code/python-venvs/testenv/bin/python\r\n\r\n(testenv) @mbp:~$ python --version\r\nPython 2.7.14\r\n```\r\n- Create sample code:\r\n```\r\n(testenv) @mbp:~$ echo '#!/Users/leszek/code/python-venvs/testenv/bin/python\r\n\r\nimport json\r\n\r\nprint var' \u003e code/python-venvs/testenv/src/test.py\r\n```\r\n- Open the `src` dir in VSCode, then open the `test.py` file, and click \"Set as interpreter\" above the first line of code to activate the interpreter provided by the virtualenv.\r\n\r\n- Go to the debugger and click on the gear icon to populate `launch.json` with default settings.\r\n\r\n- Select `Uncaught Exceptions` on the list of breakpoints\r\n\r\n- Start the debugger with the `Python` configuration selected.\r\n\r\n- The debugger breaks inside `sre_parse.py` file, instead it should break on the 5th line of code where I'm referencing undefined variable `var`.\r\n\r\n- Keep clicking on Continue or just F5 on the keyboard, the debugger keeps breaking in the same place.\r\n\r\n- In VSCode, change the interpreter to the system wide one, in my case `/usr/local/bin/python2`, installed with `brew`:\r\n```\r\n(testenv) @mbp:~$ deactivate\r\n\r\n@mbp:~$ which python2\r\n/usr/local/bin/python2\r\n\r\n@mbp:~$ /usr/local/bin/python2 --version\r\nPython 2.7.14\r\n```\r\n\r\n- Restart the debugger, it doesn't break inside `sre_parse.py` file, instead it breaks on the 5th line of my code.\r\n\r\n## Logs\r\nOutput from ```Python``` output panel \r\n```\r\n``` \r\nOutput from ```Console window``` (Help-\u003eDeveloper Tools menu)\r\n```\r\nextensionHost.ts:290 [Extension Host] debugger listening on port 9334\r\nextensionHost.ts:200 [Extension Host] debugger inspector at %cDebugger listening on port 9334.\r\nWarning: This is an experimental feature and could change at any time.\r\nTo start debugging, open the following URL in Chrome:\r\n chrome-devtools://devtools/bundled/inspector.html?experiments=true\u0026v8only=true\u0026ws=127.0.0.1:9334/739de81d-5f39-40fa-926c-e43873c6758f\r\n\r\nconsole.ts:123 [Extension Host] (node:91038) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.\r\nt.log @ console.ts:123\r\n```\r\n\r\n## Settings\r\n#### User settings:\r\n```\r\n{\r\n \"editor.rulers\": [79],\r\n \"editor.fontSize\": 11,\r\n \"terminal.integrated.fontSize\": 12,\r\n \"editor.fontFamily\": \"Menlo, Monaco, 'Courier New', monospace\",\r\n // \"python.venvPath\": \"/Users/leszek/code/python-venvs\",\r\n \"python.linting.pylintPath\": \"/usr/local/bin/pylint\",\r\n \"editor.minimap.enabled\": true,\r\n \"window.zoomLevel\": -1,\r\n // \"debug.allowBreakpointsEverywhere\": true\r\n}\r\n```\r\n#### Workspace settings:\r\n```\r\n{\r\n \"python.pythonPath\": \"/Users/leszek/code/python-venvs/testenv/bin/python\"\r\n}\r\n```\r\n#### launch.json\r\n```\r\n{\r\n // Use IntelliSense to learn about possible attributes.\r\n // Hover to view descriptions of existing attributes.\r\n // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\r\n \"version\": \"0.2.0\",\r\n \"configurations\": [\r\n {\r\n \"name\": \"Python\",\r\n \"type\": \"python\",\r\n \"request\": \"launch\",\r\n \"stopOnEntry\": true,\r\n \"pythonPath\": \"${config:python.pythonPath}\",\r\n \"program\": \"${file}\",\r\n \"cwd\": \"${workspaceFolder}\",\r\n \"env\": {},\r\n \"envFile\": \"${workspaceFolder}/.env\",\r\n \"debugOptions\": [\r\n \"RedirectOutput\"\r\n ]\r\n },\r\n ... skipping the rest here\r\n```","author":{"url":"https://github.com/leszekeljasz","@type":"Person","name":"leszekeljasz"},"datePublished":"2017-12-27T20:11:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/490/vscode-python/issues/490"}
| 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:72958d44-b024-ce94-5735-09a3af1e5560 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA18:DC47A:11FDA91:196307A:6A50A886 |
| html-safe-nonce | 1033567f18d5e4a2f10170028673c4d3198864120e1133adbdba700664dc1c33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTE4OkRDNDdBOjExRkRBOTE6MTk2MzA3QTo2QTUwQTg4NiIsInZpc2l0b3JfaWQiOiIzNzk4MTY5MjA4MDQ0NDMxNDk0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f18c6dbb982c12a3fa0f18456dec1107ba48935614e06c24c046d54b0d075c3a |
| hovercard-subject-tag | issue:284788467 |
| 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/microsoft/vscode-python/490/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d866a827f93e1265a3bc70c64a79ef5ca860eb3f51fe30e174eeca8ccabbe435/microsoft/vscode-python/issues/490 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d866a827f93e1265a3bc70c64a79ef5ca860eb3f51fe30e174eeca8ccabbe435/microsoft/vscode-python/issues/490 |
| og:image:alt | Environment data VS Code version: 1.19.1 Python Extension version: 0.9.1 Python Version: 2.7.14 OS and version: MacOs Sierra 10.12.6 Virtualenv version: 15.1.0 Actual behavior With breaking on Unca... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leszekeljasz |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/vscode-python git https://github.com/microsoft/vscode-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 106462765 |
| octolytics-dimension-repository_nwo | microsoft/vscode-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 49946255 |
| octolytics-dimension-repository_parent_nwo | DonJayamanne/pythonVSCode |
| octolytics-dimension-repository_network_root_id | 49946255 |
| octolytics-dimension-repository_network_root_nwo | DonJayamanne/pythonVSCode |
| 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 | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width