Bug 60502 - xpyb: damage.py does not work: "NameError: global name 'RECTANGLE' is not defined"
Summary: xpyb: damage.py does not work: "NameError: global name 'RECTANGLE' is not def...
Status: RESOLVED MOVED
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: 1.1
Hardware: All All
: medium major
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-08 16:04 UTC by Dan McDougall
Modified: 2019-02-16 19:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Output from make (16.58 KB, text/plain)
2013-02-12 18:25 UTC, Dan McDougall
Details
config.log (26.33 KB, text/plain)
2013-02-12 18:25 UTC, Dan McDougall
Details
Patch to fix RECTANGLE namespace. (1.92 KB, patch)
2014-08-24 02:51 UTC, Klee Dienes
Details | Splinter Review

Description Dan McDougall 2013-02-08 16:04:35 UTC
For whatever reason, the build process of xpyb results in an error in the damage.py module.  The two occurrences of RECTANGLE in the file should be xproto.RECTANGLE.  This problem seems to exist in all packages of xpyb that I've encountered (Debian/Ubuntu/pypi).

I tried looking at the Makefile and other areas of the build process to find the bug/make a patch but it is way over my head.  I don't know why damage.py is being generated incorrectly but something as simple as a search/replace at the end of the build process would work around the problem as a quick fix...

sed -i -e 's/RECTANGLE/xproto.RECTANGLE/g' damage.py

Let me know if I can be of any assistance in fixing this bug.  Thanks!
Comment 1 Daniel Martin 2013-02-09 15:57:27 UTC
Could you attach the config.log and output of make, please?

(I can't reproduce this on ArchLinux with Python 2.7. With Python 3.3 configure fires an "invalid syntax" error when searching for the include path. But, that should be a different bug.)
Comment 2 Dan McDougall 2013-02-12 18:25:12 UTC
Created attachment 74702 [details]
Output from make
Comment 3 Dan McDougall 2013-02-12 18:25:45 UTC
Created attachment 74703 [details]
config.log
Comment 4 Dan McDougall 2013-02-12 18:26:12 UTC
The make output as well as the config.log are attached.
Comment 5 Klee Dienes 2014-08-24 02:50:22 UTC
I ran into the same problem on Debian unstable using python-xcbgen 1.10-1.

I don't have convenient access to an Arch system, but it's hard for me to understand how it could be working.  Is damage.py on Arch ending up with references to xproto.RECTANGLE?  Or is RECTANGLE somehow getting loaded by damage.py?

From my brief scan, it looked to me like the problem is that py_client.py:_t is stripping the namespace information from types before emitting.  I was able to fix the problem for my purposes with the attached patch.  I undoubtedly missed some cases. I'm happy to clean it up for submission if it turns out I am on the right track.
Comment 6 Klee Dienes 2014-08-24 02:51:13 UTC
Created attachment 105182 [details] [review]
Patch to fix RECTANGLE namespace.
Comment 7 GitLab Migration User 2019-02-16 19:40:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libxcb/issues/6.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.