While trying out stubgen for the first time on a C(++)-extension module I get a 'RecursionError: maximum recursion depth exceeded' due to infinite recursion.
it runs through.
Traceback (most recent call last):
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/site-packages/mypy/stubgenc.py", line 367, in generate_c_type_stub
generate_c_type_stub(module, attr, value, types, imports=imports, sigs=sigs,
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/site-packages/mypy/stubgenc.py", line 367, in generate_c_type_stub
generate_c_type_stub(module, attr, value, types, imports=imports, sigs=sigs,
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/site-packages/mypy/stubgenc.py", line 367, in generate_c_type_stub
generate_c_type_stub(module, attr, value, types, imports=imports, sigs=sigs,
[Previous line repeated 989 more times]
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/site-packages/mypy/stubgenc.py", line 356, in generate_c_type_stub
generate_c_function_stub(module, attr, value, methods, imports=imports,
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/site-packages/mypy/stubgenc.py", line 182, in generate_c_function_stub
inferred = infer_sig_from_docstring(docstr, name)
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/site-packages/mypy/stubdoc.py", line 232, in infer_sig_from_docstring
for token in tokens:
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/tokenize.py", line 525, in _tokenize
pseudomatch = _compile(PseudoToken).match(line, pos)
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/tokenize.py", line 99, in _compile
return re.compile(expr, re.UNICODE)
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/re.py", line 252, in compile
return _compile(pattern, flags)
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/re.py", line 292, in _compile
flags = flags.value
File "/Users/pfeuffer/miniconda3/envs/pyopenms_stubs/lib/python3.9/types.py", line 178, in __get__
return self.fget(instance)
RecursionError: maximum recursion depth exceeded
Bug Report
While trying out stubgen for the first time on a C(++)-extension module I get a 'RecursionError: maximum recursion depth exceeded' due to infinite recursion.
To Reproduce
conda create --name stubs python=3.9 --channel conda-forge --channel bioconda
conda install pyopenms mypy
stubgen -p pyopenms
Expected Behavior
No error. If I add a
if (attr != class_name):herehttps://github.com/python/mypy/blob/master/mypy/stubgenc.py#L361
it runs through.
BTW: You might also need to increase the timeout here: https://github.com/python/mypy/blob/master/mypy/moduleinspect.py#L165
No clue why it is so short.
Actual Behavior
Your Environment
mypy.ini(and other config files):