Title: Debug assertion when opening some files with relative imports · Issue #291 · microsoft/python-language-server · GitHub
Open Graph Title: Debug assertion when opening some files with relative imports · Issue #291 · microsoft/python-language-server
X Title: Debug assertion when opening some files with relative imports · Issue #291 · microsoft/python-language-server
Description: I wouldn't open this except that it fails in a debug build, which I assume means that it's a pretty unexpected error. My environment: macOS 10.14 VSCode 1.28.2 Python Extension, 2018.9.1, with trace logging enabled A debug build of the p...
Open Graph Description: I wouldn't open this except that it fails in a debug build, which I assume means that it's a pretty unexpected error. My environment: macOS 10.14 VSCode 1.28.2 Python Extension, 2018.9.1, with trac...
X Description: I wouldn't open this except that it fails in a debug build, which I assume means that it's a pretty unexpected error. My environment: macOS 10.14 VSCode 1.28.2 Python Extension, 2018.9.1, w...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/291
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Debug assertion when opening some files with relative imports","articleBody":"I wouldn't open this except that it fails in a debug build, which I assume means that it's a pretty unexpected error.\r\n\r\nMy environment:\r\nmacOS 10.14\r\nVSCode 1.28.2\r\nPython Extension, 2018.9.1, with trace logging enabled\r\nA **debug** build of the python-language-server (mine's at 6d4659fe34b52922b6770675801d73e5debbc105)\r\n\r\nTake the following archive: [test.tar.gz](https://github.com/Microsoft/python-language-server/files/2498511/test.tar.gz) and extract it somewhere (\\~/code). Open the folder (\\~/code/test) in VSCode, and then, as strange as this seems, use the explorer and open all the files in order, from the bottom up.\r\n\r\nIn other words, open `util.py`, `main.py`, `lib/util.py`, `lib/test.py`, and then `lib/__init__.py`. Then, observe the Python output window:\r\n\r\n```\r\nFailed to get module test we just imported\r\n\r\n at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(ImportStatement node) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Analyzer/DDG.cs:line 568\r\n at Microsoft.PythonTools.Parsing.Ast.ImportStatement.Walk(PythonWalker walker) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Parsing/Ast/ImportStatement.cs:line 65\r\n at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Analyzer/DDG.cs:line 666\r\n at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Parsing/Ast/SuiteStatement.cs:line 34\r\n at Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk(PythonWalker walker) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Parsing/Ast/PythonAst.cs:line 92\r\n at Microsoft.PythonTools.Analysis.AnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/AnalysisUnit.cs:line 154\r\n at Microsoft.PythonTools.Analysis.AnalysisUnit.Analyze(DDG ddg, CancellationToken cancel) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/AnalysisUnit.cs:line 139\r\n at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Analyzer/DDG.cs:line 75\r\n at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/PythonAnalyzer.cs:line 924\r\n at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Intellisense/AnalysisQueue.cs:line 229\r\n at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Intellisense/AnalysisQueue.cs:line 152\r\n at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine\u0026 stateMachine)\r\n at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken)\r\n at Microsoft.PythonTools.Intellisense.AnalysisQueue.\u003c\u003ec__DisplayClass31_0.\u003cEnqueue\u003eb__0(CancellationToken ct) in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Intellisense/AnalysisQueue.cs:line 136\r\n at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumerLoop() in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Intellisense/AnalysisQueue.cs:line 64\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()\r\n at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)\r\n at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)\r\n at System.Threading.Tasks.Task`1.TrySetResult(TResult result)\r\n at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result)\r\n at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(TResult result)\r\n at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumeAsync() in /Users/username/code/python-language-server/src/Analysis/Engine/Impl/Intellisense/AnalysisQueue.cs:line 89\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()\r\n at System.Threading.ThreadPoolWorkQueue.Dispatch()\r\n[Info - 1:24:51 PM] Connection to server got closed. Server will restart.\r\n[Error - 1:24:51 PM] Request textDocument/documentSymbol failed.\r\n```\r\n---\r\nA very cursory debugging seems to show that the lookup fails because the ModuleTable has an entry for 'lib.test' rather than 'test', but I don't know if that's actually the culprit, or if that's even a problem.","author":{"url":"https://github.com/richardwb","@type":"Person","name":"richardwb"},"datePublished":"2018-10-20T20:48:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/291/python-language-server/issues/291"}
| 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:a668b9ae-868b-5dd4-8570-814ed2e38fe2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 901E:3337F1:804DFD:B42EAA:6A4E7D98 |
| html-safe-nonce | a0538f29ee3f977726d8c8947382061402546ea66005af2490cb5c160bdc5361 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDFFOjMzMzdGMTo4MDRERkQ6QjQyRUFBOjZBNEU3RDk4IiwidmlzaXRvcl9pZCI6IjU0NTk5NjAwOTg5MDU0NTA0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8be9686a57c6613c4a0a75f25010816c31c9f81ea0ee631de46e6b58cca4cb1e |
| hovercard-subject-tag | issue:372251437 |
| 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/python-language-server/291/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01a1c1b96d3f7b5c6f830d06eed64341ddd045ee124ceab7bef3928541b30f51/microsoft/python-language-server/issues/291 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01a1c1b96d3f7b5c6f830d06eed64341ddd045ee124ceab7bef3928541b30f51/microsoft/python-language-server/issues/291 |
| og:image:alt | I wouldn't open this except that it fails in a debug build, which I assume means that it's a pretty unexpected error. My environment: macOS 10.14 VSCode 1.28.2 Python Extension, 2018.9.1, with trac... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | richardwb |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width