[Xapian-discuss] ucs2 build of xapian?

Olly Betts olly at survex.com
Wed Dec 19 04:11:32 GMT 2007


On Thu, Dec 13, 2007 at 01:56:02PM -0800, Jason Witherspoon wrote:
> Recompiling everything from scratch now, on top of ucs2-Python, I get
> the same problem:
>
> Traceback (most recent call last):
>    File "xap_indexer.py", line 4, in <module>
>      import xapian
>    File "/usr/lib/python2.5/site-packages/xapian.py", line 6, in 
> <module>
>      import _xapian
> ImportError: /usr/lib/python2.5/site-packages/_xapian.so: undefined 
> symbol: PyUnicodeUCS4_EncodeUTF8

OK, so what we need to do is work out why this is failing like this.

The Python bindings code just calls PyUnicode_EncodeUTF8.  Looking at
the python headers:

/usr/include/python2.5/unicodeobject.h

has:

    #ifndef Py_UNICODE_WIDE
    [...]
    # define PyUnicode_EncodeUTF8 PyUnicodeUCS2_EncodeUTF8
    [...]
    #else
    [...]
    # define PyUnicode_EncodeUTF8 PyUnicodeUCS4_EncodeUTF8
    [...]
    #endif
    
And apart from a later prototype, that's the only mention of
PyUnicode_EncodeUTF8 in the python headers.

The only place in the headers where Py_UNICODE_WIDE is defined is
earlier in the same header:

    #if Py_UNICODE_SIZE >= 4
    #define Py_UNICODE_WIDE
    #endif

So what does this command report for you?

    grep Py_UNICODE_SIZE /usr/include/python2.5/pyconfig.h

Cheers,
    Olly



More information about the Xapian-discuss mailing list