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

Null Reference Exception #534

Description

@jerryc05

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

Activity

  1. jerryc05 commented on Jan 18, 2019

    @jerryc05
    Author

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

  2. jakebailey commented on Jan 18, 2019

    @jakebailey
    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.

  3. jerryc05 commented on Jan 18, 2019

    @jerryc05
    Author

    Jake Bailey (@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.

  4. MikhailArkhipov commented on Feb 8, 2019

    @MikhailArkhipov

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions