pipenv: RuntimeError: maximum recursion depth exceeded
Trying 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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 47 (43 by maintainers)
Commits related to this issue
- edge case for #673 Signed-off-by: Kenneth Reitz <me@kennethreitz.org> — committed to pypa/pipenv by kennethreitz 7 years ago
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
that is… weird.
fixed in v7.8.6!