This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
NRE in HandleModuleImportStar #1314
Copy link
Copy link
Closed
Description
Using the setup in #364, hovering over __path__ gives:
Opening document file:///c:/Users/jabaile/test_projects/issue364/app.py
Analysis of app(User) queued
Import: parent.child.one c:\Users\jabaile\test_projects\issue364\parent\child\one.py
Analysis version 2 of 1 entries has started.
Analysis of parent.child.one(User) queued
Analysis of app(User) failed. Exception message: Object reference not set to an instance of an object..
Analysis version 2 of 1 entries has been completed in 17.2121 ms.
Analysis version 4 of 2 entries has started.
Analysis of parent.child.one(User) on depth 0 completed for library in 8.1233 ms.
Analysis of app(User) failed. Exception message: Object reference not set to an instance of an object..
Analysis complete: 2 modules in 67.6934 ms.
Analysis version 4 of 2 entries has been completed in 15.2549 ms.
complete.
Hover in file:///c:/Users/jabaile/test_projects/issue364/app.py at (2, 15)
[Error - 1:00:14 PM] Request textDocument/hover failed.
Message: Object reference not set to an instance of an object.
Code: -32000
at Microsoft.Python.Analysis.Analyzer.Handlers.ImportHandler.HandleModuleImportStar(PythonVariableModule variableModule) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\Handlers\FromImportHandler.cs:line 79
at Microsoft.Python.Analysis.Analyzer.Handlers.ImportHandler.AssignVariables(FromImportStatement node, IImportSearchResult imports, PythonVariableModule variableModule) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\Handlers\FromImportHandler.cs:line 62
at Microsoft.Python.Analysis.Analyzer.Handlers.ImportHandler.HandleFromImport(FromImportStatement node) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\Handlers\FromImportHandler.cs:line 45
at Microsoft.Python.Parsing.Ast.FromImportStatement.Walk(PythonWalker walker) in C:\Users\jabaile\python-language-server\src\Parsing\Impl\Ast\FromImportStatement.cs:line 56
at Microsoft.Python.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker) in C:\Users\jabaile\python-language-server\src\Parsing\Impl\Ast\SuiteStatement.cs:line 41
at Microsoft.Python.Parsing.Ast.PythonAst.Walk(PythonWalker walker) in C:\Users\jabaile\python-language-server\src\Parsing\Impl\Ast\PythonAst.cs:line 81
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.AnalyzeEntry(IDependencyChainNode`1 node, PythonAnalyzerEntry entry, IPythonModule module, PythonAst ast, Int32 version) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzerSession.cs:line 322
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.Analyze(IDependencyChainNode`1 node, AsyncCountdownEvent ace, Stopwatch stopWatch) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzerSession.cs:line 256
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerEntry.<>c.<GetAnalysisAsync>b__25_0(Task`1 t) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzerEntry.cs:line 99
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.GetAnalysisAsync(PythonAnalyzerEntry entry, CancellationToken timeoutCt, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzer.cs:line 98
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.GetAnalysisAsync(IPythonModule module, Int32 waitTime, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzer.cs:line 91
at Microsoft.Python.LanguageServer.Documents.Document.GetAnalysisAsync(Uri uri, IServiceContainer services, Int32 msTimeout, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Documents\Document.cs:line 35
at Microsoft.Python.LanguageServer.Implementation.Server.Hover(TextDocumentPositionParams params, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Implementation\Server.Editor.cs:line 56
at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Hover(JToken token, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\LanguageServer.cs:line 221
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
- Fix microsoft#1314: NRE in HandleModuleImportStar bug
Bug and test fixes (#1322)
Bug and test fixes (microsoft#1322)