Many undefined name errors in python-xpyb package
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
xpyb (Debian) |
Fix Released
|
Unknown
|
|||
xpyb (Ubuntu) |
Confirmed
|
Undecided
|
bomkim |
Bug Description
The python-xpyb package in Ubuntu is broken. I believe it has to do with the way the package is built because the same package is not broken on other Linux distros (e.g. Arch, Gentoo, etc) and they're not doing any sort of interesting patching as part of their build process (that I could see, anyway). So it's not an upstream problem. The problem is that various references to xproto classes such as "xproto.RECTANGLE" wind up as undefined names in the files. So instead of having, "xproto.RECTANGLE" (which is correct) several xpyb files will just have "RECTANGLE" (which is an undefined name). This results in tracebacks like this:
Traceback (most recent call last):
File "/usr/local/
File "/usr/local/
File "/usr/local/
ret = fn(*args, **kwargs)
File "/opt/gateone/
e = self.conn.
File "/usr/lib/
self.area = RECTANGLE(parent, offset, 8)
NameError: global name 'RECTANGLE' is not defined
The fix for that one is easy: Change the use of "RECTANGLE" with "xproto.RECTANGLE". In damage.py it's only two lines. The problem though is that undefined names like that can be found in several other files:
riskable@
damage.py:46: undefined name 'RECTANGLE' <-- Needs to be xproto.RECTANGLE
damage.py:49: undefined name 'RECTANGLE' <-- Needs to be xproto.RECTANGLE
__init__.py:1: 'from xcb import *' used; unable to detect undefined names <-- Ignore this one =)
randr.py:284: undefined name 'TRANSFORM' <-- Needs to be render.TRANSFORM
randr.py:289: undefined name 'TRANSFORM' <-- Needs to be render.TRANSFORM
render.py:290: undefined name 'STR' <-- Needs to be xproto.STR
shape.py:66: undefined name 'RECTANGLE' <-- Needs to be xproto.RECTANGLE
xfixes.py:92: undefined name 'RECTANGLE' <-- Needs to be xproto.RECTANGLE
xfixes.py:96: undefined name 'RECTANGLE' <-- Needs to be xproto.RECTANGLE
xvmc.py:83: undefined name 'ImageFormatInfo' <-- Needs to be xv.ImageFormatInfo
I suspect this is caused by the build process which I believe is using SWIG. There's probably a file somewhere that needs to be tweaked to ensure the auto-generated .py files get the proper names for these things.
Unfortunately my knowledge of SWIG and auto-generation of C bindings is near zero. Otherwise I'd fix it myself and provide a patch. I can provide a post-build patch that will correct the files but I believe the best course of action is to simply fix whatever it is in the build process that's causing the breakage... Like I said previously, only Ubuntu seems to have this problem with this particular package.
Thanks for any and all assistance in getting this problem corrected!
Changed in xpyb (Debian): | |
status: | Unknown → New |
Changed in xpyb (Ubuntu): | |
assignee: | nobody → bomkim (oozz1373) |
Changed in xpyb (Debian): | |
status: | New → Fix Released |
Just wanted to share what I found out so far:
The package xcb-proto contains XML protocol definitions like damage.xml (upstream doc: http:// cgit.freedeskto p.org/xcb/ proto/tree/ doc/xml- xcb.txt ).
Python bindings are generated from these definitions using custom generator modules. The modules are part of another Debian package (python-xcbgen), also built from the source package xcb-proto.
xcbgen is imported by py_client.py in the xpyb source package, which just calls the parsing module for each XML protocol definition.
I think the issue is somewhere in python-xcbgen, but could not look into it further yet.