Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Null Reference Exception #534

Closed
jerryc05 opened this issue Jan 17, 2019 · 4 comments
Closed

Null Reference Exception #534

jerryc05 opened this issue Jan 17, 2019 · 4 comments

Comments

@jerryc05
Copy link

Hi! I tried clearing the whole vscode directory and reinstalled vscode and every plugin, but I still get this error. But strangely it only happen on one of my computers. On all others it works fine. Could you pls help? thx!

step to reproduce:
open vscode, open a .py file, and wait for around 10 sec.

Starting Microsoft Python language server.
##########Linting Output - pylint##########

--------------------------------------------------------------------

Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)



Microsoft Python Language Server version 0.1.75.0
Initializing for C:\Program Files\Python37\python.exe
[Error - 9:13:37 PM] System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PythonTools.Analysis.AnalysisSet.Split[T](IAnalysisSet set, IReadOnlyList`1& ofType, IAnalysisSet& rest)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluatorAnnotationConverter.FinalizeNames(IAnalysisSet types)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluatorAnnotationConverter.MakeGeneric(IAnalysisSet baseType, IReadOnlyList`1 args)
   at Microsoft.PythonTools.Parsing.Ast.TypeAnnotation.Walker.MakeGenericOp.Apply[T](TypeAnnotationConverter`1 converter, Stack`1 stack)
   at Microsoft.PythonTools.Parsing.Ast.TypeAnnotation.Walker.GetResult[T](TypeAnnotationConverter`1 converter)
   at Microsoft.PythonTools.Analysis.Values.TypingTypeInfo.<>c__DisplayClass8_0.<GetIndex>b__0(Node n)
   at Microsoft.PythonTools.Analysis.Analyzer.InterpreterScope.GetOrMakeNodeValue(Node node, NodeValueKind kind, Func`2 maker)
   at Microsoft.PythonTools.Analysis.AnalysisValueSetExtensions.GetIndex(IAnalysisSet self, Node node, AnalysisUnit unit, IAnalysisSet index)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Node node)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(ReturnStatement node)
   at Microsoft.PythonTools.Parsing.Ast.ReturnStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node)
   at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.Analyzer.FunctionAnalysisUnit.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()
[Error - 9:13:37 PM] System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PythonTools.Analysis.AnalysisSet.Split[T](IAnalysisSet set, IReadOnlyList`1& ofType, IAnalysisSet& rest)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluatorAnnotationConverter.FinalizeNames(IAnalysisSet types)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluatorAnnotationConverter.MakeGeneric(IAnalysisSet baseType, IReadOnlyList`1 args)
   at Microsoft.PythonTools.Parsing.Ast.TypeAnnotation.Walker.MakeGenericOp.Apply[T](TypeAnnotationConverter`1 converter, Stack`1 stack)
   at Microsoft.PythonTools.Parsing.Ast.TypeAnnotation.Walker.GetResult[T](TypeAnnotationConverter`1 converter)
   at Microsoft.PythonTools.Analysis.Values.TypingTypeInfo.<>c__DisplayClass8_0.<GetIndex>b__0(Node n)
   at Microsoft.PythonTools.Analysis.Analyzer.InterpreterScope.GetOrMakeNodeValue(Node node, NodeValueKind kind, Func`2 maker)
   at Microsoft.PythonTools.Analysis.AnalysisValueSetExtensions.GetIndex(IAnalysisSet self, Node node, AnalysisUnit unit, IAnalysisSet index)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Node node)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(ReturnStatement node)
   at Microsoft.PythonTools.Parsing.Ast.ReturnStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node)
   at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.Analyzer.FunctionAnalysisUnit.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()

microsoft/vscode-python#3970

@jerryc05
Copy link
Author

I tried the solution below, but it did not work.
#72

@jakebailey
Copy link
Member

Reinstalling things shouldn't fix anything, no.

Do you have a public codebase we can use to reproduce this? I know about this specific backtrace, but haven't been able to reproduce it myself.

@jerryc05
Copy link
Author

jerryc05 commented Jan 18, 2019

@jakebailey Hi I got a quick fix.
It could be solved by deleting everything in the workspace (or create a new one and copy only the code files).
I noticed that I had a folder named "pyta" which seemed to be produced by some other programs. After I deleted this folder, everything else went fine.

@MikhailArkhipov
Copy link

N/A after #546. This code is gone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants