securesauce/precli

RecursionError: maximum recursion depth exceeded

ericwb opened this issue · 1 comments

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/python/cpython
  2. precli --debug ../cpython/Lib/test/test_traceback.py
  3. See error
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
  File "/Users/ericwb/workspace/precli/precli/parsers/python.py", line 155, in visit_assignment
    self.visit(nodes)
  File "/Users/ericwb/workspace/precli/precli/parsers/__init__.py", line 121, in visit
    visitor_fn(node.children)
RecursionError: maximum recursion depth exceeded

Expected behavior
No errors

Version

precli 0.5.4
Copyright 2024 Secure Saurce LLC
License BUSL-1.1: Business Source License 1.1 <https://spdx.org/licenses/BUSL-1.1.html>
  Python 3.12.2 (main, May 13 2024, 16:18:42) [Clang 15.0.0 (clang-1500.3.9.4)]

Additional context

The root cause is a very huge assignment statement. Many variables being assigned at once.

https://github.com/python/cpython/blob/a8e35e8ebad8c3bb44d14968aa05d1acbc028247/Lib/test/test_traceback.py#L4240