RuntimeError: found a situation in which we try to build a type recursively.

Create issue
Issue #429 resolved
Laurent Gautier created an issue

The error is:

RuntimeError: found a situation in which we try to build a type recursively.  This is known to occur e.g. in ``struct s { void(*callable)(struct s); }''.  Please report if you get this error and really need support for your case.

The issue is otherwise also opened on the rpy2 project’s page: https://bitbucket.org/rpy2/rpy2/issues/591 and can be triggered with the following sequence of bash sequences:

RPY2_CFFI_MODE=ABI pip install rpy2
# The error occurs on import
python -m rpy2.rinterface

RPY2_CFFI_MODE=API pip install rpy2
# Everything is fine (assuming you have a dev environment to install the API mode)
python -m rpy2.rinterface

Comments (6)

  1. Armin Rigo

    The line RPY2_CFFI_MODE=ABI pip install rpy2, running in a virtualenv containing CPython 3.6 (tried with 3.8 too), fails for me with:

    ...
          File "/tmp/pip-install-j2n29h2i/rpy2/rpy2/situation.py", line 141, in _get_r_cmd_config
            r_exec = get_r_exec(r_home)
          File "/tmp/pip-install-j2n29h2i/rpy2/rpy2/situation.py", line 130, in get_r_exec
            r_exec = os.path.join(r_home, 'bin', 'R')
          File "/tmp/venv/lib/python3.6/posixpath.py", line 80, in join
            a = os.fspath(a)
        TypeError: expected str, bytes or os.PathLike object, not NoneType
    

    Is that expected?

  2. Armin Rigo

    I do not. Can you give me a full step-by-step guide about what I should do to reproduce? Alternatively, you can extract a small self-contained example, like the one you started this issue with but more complete---I guess it just needs the complete cdef(), which can be run without having anything installed, and then the line on which the crash occurs, which should contain a reference to one of the types.

  3. Log in to comment