[Pyxpcomext] ImportError with _Py_ZeroStruct in C extension

William Cauchois wcauchois at gmail.com
Sat Feb 6 16:10:55 PST 2010


I'm working on a Firefox extension that uses pyxpcomext. Great work by the
way, pyxpcomext has been immensely helpful! However, we are loading some
Python code that imports a C extension -- cjson in fact, a library for
parsing JSON -- and we're getting a really weird error. The traceback looks
like this:

> ...
>  File "/home/toddw/src/pyxpcomext/src/build/
pythonext at mozdev.org/python/lib/python2.6/ihooks.py", line 170, in
>  File "/home/phyrephox/Code/reform/reformFF/components/reformpy.py", line
52, in <module>
>    from reformServe import handlers,State,nodes,align
>  File "/home/phyrephox/.mozilla/firefox/3tn4oxjv.reform/extensions/
pythonext at mozdev.org/pylib/reformServe/handlers.py", line 2, in <module>
>    import time, cjson, string, cgi, nodes, State
> ImportError: /home/phyrephox/.mozilla/firefox/3tn4oxjv.reform/extensions/
pythonext at mozdev.org/pylib/reformServe/cjson.so: undefined symbol:

I took special care to build a UCS2 Python and use that to build cjson,
since I'm on Ubuntu 9.10 which is UCS4 by default. Another funny thing is
that my colleague can use the exact same copy of cjson.so on Ubuntu 9.10 and
have it work for him. We spent a lot of time trying figure out how our
systems were different, but couldn't come up with anything substantial. I'm
not sure what other steps to take to debug this issue. Does anyone have any

Thanks very much,
Bill Cauchois
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mozdev.org/pipermail/pyxpcomext/attachments/20100206/b4a93f48/attachment.html>

More information about the Pyxpcomext mailing list