Package: python-xlib
Version: 0.12-5
Severity: normal
Tags: patch
In many cases when trying to run a program which uses python-xlib you get a
traceback similar to...
Traceback (most recent call last):
File "./stylebox", line 31, in ?
s = StyleBox()
File "/home/jae/Current/Openbox/stylebox/StyleBox.py", line 668, in
__init__
self.display = Display()
File "/usr/lib/python2.3/site-packages/Xlib/display.py", line 80, in
__init__
self.display = _BaseDisplay(display)
File "/usr/lib/python2.3/site-packages/Xlib/display.py", line 67, in
__init__
apply(protocol.display.Display.__init__, (self, ) + args, keys)
File "/usr/lib/python2.3/site-packages/Xlib/protocol/display.py", line
123, in __init__
self.default_screen = min(self.default_screen, len(self.info.roots) -
1)
File "/usr/lib/python2.3/site-packages/Xlib/protocol/rq.py", line 1371,
in __getattr__
raise AttributeError(attr)
AttributeError: roots
Found a solution for this on the pypanel forum from pypanel's author. To
quote...
http://sourceforge.net/forum/message.php?msg_id=3195860
--------------
This is a problem with Python-Xlib. Under certain conditions, the receive
buffer size isn't large enough. To fix it, open the following file -
/usr/lib/python<version>/site-packages/Xlib/protocol/display.py
and change line 530 from -
recv = self.socket.recv(2048)
to -
recv = self.socket.recv(4096)
4096 should be large enough ..
--------------
This fixed the problem I was having. I have included a patch doing just
this.
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.15-ck3
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages python-xlib depends on:
ii python 2.3.5-5 An interactive high-level object-o
ii python2.3-xlib 0.12-5 Interface for Python to the X11 Pr
python-xlib recommends no packages.
-- no debconf information
--- display.py.orig 2006-03-17 12:53:13.000000000 -0500
+++ display.py 2006-03-17 12:52:54.000000000 -0500
@@ -528,7 +528,7 @@
# We're the recieving thread, parse the data
if recieving:
try:
- recv = self.socket.recv(2048)
+ recv = self.socket.recv(4096)
except socket.error, err:
self.close_internal('server: %s' % err[1])
raise self.socket_error