Description
Environment data
- VS Code version: 1.27.1 & 1.28.0-insider (clean installs)
- Extension version (available under the Extensions sidebar): 2018.8.0
- OS and version: Windows 10 Pro Version 10.0.17134.228
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.7 64-bit (clean install)
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): NA
- Relevant/affected Python packages and their versions: None
Actual behavior
Output for Python
in the Output
panel opens with a "System.NullReferenceException" error after typing "from ." in an "__init__.py" file.
Expected behavior
No error
Steps to reproduce:
- Create an empty folder
- Open the folder with vscode or vscode-insider
- Create a new file "__init__.py"
- Start typing "from ."
The error occurs after typing the dot. The error does not occur with other file names (e.g. "some_file.py"). I cannot tell if this is related to a closed issue with a similar error.
Screenshots at the bottom.
Logs
Output for Python
in the Output
panel:
[Error - 8:33:17 AM] System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.PythonTools.Analysis.ModuleResolver.GetModuleFullName(String originatingModule, String relativePath)
at Microsoft.PythonTools.Analysis.ModuleResolver.ResolvePotentialModuleNames(String importingFromModuleName, String importingFromFilePath, String relativeModuleName, Boolean absoluteImports)+MoveNext()
at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable
1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.TryImportModule(String modName, Boolean forceAbsolute, ModuleReference& moduleRef, IReadOnlyList1& remainingParts) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(FromImportStatement node) at Microsoft.PythonTools.Parsing.Ast.FromImportStatement.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node) at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker) at Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.AnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque
1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval)
at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumerLoop()
Output from Console
under the Developer Tools
panel:
None