Run into error under PyPy 5.8.0

Issue #253 resolved
Chuancong Gao
created an issue

I have run into some error under PyPy 5.8.0 on macOS. Not sure what caused the problem. It worked fine on CPython and PyPy 5.7.1. Can you kindly help? Thanks.

  File "/usr/local/Cellar/pypy/5.8.0/libexec/site-packages/regex.py", line 387, in <module>
    import _regex_core
  File "/usr/local/Cellar/pypy/5.8.0/libexec/site-packages/_regex_core.py", line 21, in <module>
    import _regex
ImportError: unable to load extension module '/usr/local/Cellar/pypy/5.8.0/libexec/site-packages/_regex.pypy-41.so': dlopen(/usr/local/Cellar/pypy/5.8.0/libexec/site-packages/_regex.pypy-41.so, 6): Symbol not found: _PySlice_GetIndicesEx
  Referenced from: /usr/local/Cellar/pypy/5.8.0/libexec/site-packages/_regex.pypy-41.so
  Expected in: flat namespace
 in /usr/local/Cellar/pypy/5.8.0/libexec/site-packages/_regex.pypy-41.so

Comments (10)

  1. Nathaniel Smith

    See also https://bitbucket.org/pypy/pypy/issues/2654/symbol-not-found-_pyslice_getindicesex

    Weird things:

    • The fix in 14b2b99d7c7d59095abe8f62302c88ead24538d6 ought to have fixed the problem on Python 3, and yet here's the problem showing up on PyPy3 and regex-2017.7.28: https://travis-ci.org/theelous3/asks/jobs/277163684 (to verify the regex version number, you have to expand the line labeled $ pip3 install pytest-httpbin)

    • For some reason there's code hacking at PySlice_GetIndicesEx in the regex_2 directory, even though the problem with PySlice_GetIndicesEx only happens on Python 3.6.1.

  2. Nathaniel Smith

    Oh, heh. So I guess @Matthew Barnett bumped the version to 2017.07.28 and made a release, but forgot to commit it, and then later fixed #240 and committed both the fix and the version bump together? In that case I guess the fix is:

    • delete the #undef PySlice_GetIndicesEx stuff from regex_2/
    • make a release :-)
  3. Matthew Barnett repo owner

    I made a change in my sources, but I was waiting for a confirmation that it had worked before making a release. I then gradually forgot about it as time passed. Are you confirming that it works?

  4. Nathaniel Smith

    There's something weird going on with your build system when I try to install under pypy3 -- running pypy3 setup.py install in an hg checkout says

    file regex_3/regex.py (for module regex) not found
    file regex_3/_regex_core.py (for module _regex_core) not found
    file regex_3/test_regex.py (for module test_regex) not found
    file regex_3/regex.py (for module regex) not found
    file regex_3/_regex_core.py (for module _regex_core) not found
    file regex_3/test_regex.py (for module test_regex) not found
    

    and I do end up with an installed _regex.pypy3-59-x86_64-linux-gnu.so, but no regex module or package. I'm guessing this is some unrelated issue?

    Anyway, I can confirm that with the latest hg checkout and the latest pypy3 nightly build, there isn't any problem with PySlice_GetIndicesEx. However, import _regex still doesn't work, because pypy3 doesn't seem to have implemented PyUnicode_Substring and PyLong_FromUnicodeObject yet :-(. OTOH this is probably something they need to fix on their side.

    Regarding the python 2 version, I haven't checked on pypy2, but since the #undef PySlice_GetIndicesEx code is meaningless on CPython 2, deleting it can't hurt and will certainly help :-).

  5. Log in to comment