[pypy-dev] regex (new re) and 1.6

Maciej Fijalkowski fijall at gmail.com
Sat Aug 20 09:51:32 CEST 2011


On Fri, Aug 19, 2011 at 10:07 PM, Serhat Sevki Dincer
<jfcgauss at gmail.com> wrote:
> http://pypi.python.org/pypi/regex installs nicely on pypy-1.6 on my
> Ubuntu 11.04 i386 but
>
>>>>> from regex import sub
> Traceback (most recent call last):
>  File "<console>", line 1, in <module>
>  File "/var/Home/serhat/Program/pypy-1.6/site-packages/regex.py",
> line 343, in <module>
>    from _regex_core import *
>  File "/var/Home/serhat/Program/pypy-1.6/site-packages/_regex_core.py",
> line 21, in <module>
>    import _regex
> ImportError: unable to load extension module
> '/var/Home/serhat/Program/pypy-1.6/site-packages/_regex.pypy-16.so':
> /var/Home/serhat/Program/pypy-1.6/site-packages/_regex.pypy-16.so:
> undefined symbol: Py_UNICODE_TOTITLE
>
> I dont see any (in)compatibility info on
> https://bitbucket.org/pypy/compatibility/wiki/regex.
>
> Also
> pypy-1.6$ grep -r 'Py_UNICODE_TO' include/
> include/pypy_decl.h:PyAPI_FUNC(wchar_t) Py_UNICODE_TOLOWER(wchar_t arg0);
> include/pypy_decl.h:PyAPI_FUNC(wchar_t) Py_UNICODE_TOUPPER(wchar_t arg0);
>
> TOTITLE is missing?
> http://docs.python.org/release/2.7.2/library/stdtypes.html#str.title
> is working on (unicode) strings in pypy. I dont get it, what do u
> think is up?

yes, TOTITLE is not implemented in cpyext, the cpython C compatibility
layer. Btw - what are you trying to achieve? If you want to compare
regex performance on pypy and cpython, it'll probably be much slower
on pypy. The C extensions layer is just a compatibility one (it's also
in beta).

Cheers,
fijal

> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev
>


More information about the pypy-dev mailing list