[pypy-issue] Issue #2221: PyStructSequence_SET_ITEM() crashes on PyPy3 in scandir C module (pypy/pypy)

Ben Hoyt issues-reply at bitbucket.org
Sat Jan 2 20:11:35 EST 2016


New issue 2221: PyStructSequence_SET_ITEM() crashes on PyPy3 in scandir C module
https://bitbucket.org/pypy/pypy/issues/2221/pystructsequence_set_item-crashes-on-pypy3

Ben Hoyt:

I'm the author of the [scandir module](https://github.com/benhoyt/scandir) and I've been trying to get it compiling on PyPy3 (see [this issue](https://github.com/benhoyt/scandir/issues/51)). I did get it compiling, but it crashes on the `DirEntry.stat()` call due to this line of code in _scandir.c:

    PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode));

I believe the reason is that this is a macro that directly sets something in a structure, which PyPy probably doesn't like?

I realize supporting the C API is "alpha level" and probably isn't a top priority for PyPy right now, but just thought I'd make you aware. And if there's an easy fix I could do in _scandir.c, I'd appreciate any pointers there.

I'm running PyPy3 2.4.0 on Linux.




More information about the pypy-issue mailing list