RuntimeError: maximum recursion depth exceeded
See original GitHub issueTrying to convert my production app, I get a recursion error:
$ cat requirements.txt | wc -l
201
$ pipenv lock
Requirements.txt found, instead of Pipfile! Converting…
Traceback (most recent call last):
File "/Users/philfreo/Library/Python/2.7/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/cli.py", line 1787, in lock
ensure_project(three=three, python=python)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/cli.py", line 577, in ensure_project
ensure_pipfile(validate=validate)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/cli.py", line 291, in ensure_pipfile
import_requirements()
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/cli.py", line 251, in import_requirements
project.add_package_to_pipfile(str(package.req), dev=dev)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/project.py", line 413, in add_package_to_pipfile
p = self._pipfile
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/project.py", line 212, in _pipfile
pfile = self.parsed_pipfile
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/project.py", line 207, in parsed_pipfile
return contoml.loads(contents)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/contoml/__init__.py", line 15, in loads
elements = parse_tokens(tokens)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/prettytoml/parser/__init__.py", line 17, in parse_tokens
return _parse_token_stream(TokenStream(tokens))
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/prettytoml/parser/__init__.py", line 29, in _parse_token_stream
elements, pending = toml_file_elements(token_stream)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 375, in toml_file_elements
captured = capture_from(token_stream).find(one).or_find(file_entry_element).or_empty()
.......... middle of very large stack trace omitted (lmk if you want the full version) ......
element, pending_ts = finder(self._token_stream)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 98, in more
c = capture_from(ts).find(token(token_type)).and_find(zero_or_more_tokens(token_type))
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 33, in find
element, pending_ts = finder(self._token_stream)
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 58, in factory
raise ParsingError('Expected a token of type {}'.format(token_type))
File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/patched/prettytoml/tokens/__init__.py", line 30, in __repr__
return "{}-{}".format(self.priority, self._name)
RuntimeError: maximum recursion depth exceeded
It makes some good progress before crashing:
$ cat Pipfile | wc -l
193
Issue Analytics
- State:
- Created 6 years ago
- Comments:46 (43 by maintainers)
Top Results From Across the Web
maximum recursion depth exceeded while calling a Python ...
That's the error you get when a function makes too many recursive calls to itself. It might be doing this because ...
Read more >Python: Maximum Recursion Depth Exceeded [How to Fix It]
The maximum recursion depth in Python is 1000. To check it, call sys.getrecursionlimit() function. To change it, call sys.setrecursionlimit().
Read more >(Python) RecursionError: maximum recursion depth exceeded
The Python "RecursionError: maximum recursion depth exceeded" occurs when a function is being called so many times that the invocations ...
Read more >maximum recursion depth exceeded while calling a Python ...
When we run the recursion function for a large number of times, recursion error is thrown. Python has a limit on the number...
Read more >Python maximum recursion depth exceeded in comparison
The “maximum recursion depth exceeded in comparison” error is raised when you try to execute a function that exceeds Python's built in recursion...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yeah it’s a wrapper around pip reqs. will probably give you a lot of false positives, but it’d be a place to start.
this is a goldmine of edgecases