Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 96093 - x11-misc/pypanel fails to start and raises an AttributeError(attr)
Summary: x11-misc/pypanel fails to start and raises an AttributeError(attr)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Python Gentoo Team
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
: 169900 (view as bug list)
Depends on: 169915
Blocks:
  Show dependency tree
 
Reported: 2005-06-14 09:26 UTC by Zaid A.
Modified: 2007-06-30 23:02 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zaid A. 2005-06-14 09:26:44 UTC
Pypanel-2.3 was working fine until I updated a few packages, the list of
packages updated that day were:
Mon Jun  6 01:19:56 2005 >>> sys-devel/gcc-config-1.3.11
 Mon Jun  6 01:21:05 2005 >>> dev-libs/atk-1.9.1
 Mon Jun  6 01:21:40 2005 >>> x11-misc/shared-mime-info-0.16
 Mon Jun  6 01:32:24 2005 >>> x11-libs/gtk+-2.6.7
 Mon Jun  6 01:33:44 2005 >>> gnome-base/librsvg-2.9.5
 Mon Jun  6 01:34:28 2005 >>> gnome-base/libglade-2.5.0
 Mon Jun  6 01:35:28 2005 >>> media-video/nvidia-kernel-1.0.7664
 Mon Jun  6 01:35:58 2005 >>> media-video/nvidia-glx-1.0.7664
 Mon Jun  6 01:36:08 2005 >>> dev-libs/cgilib-0.5
 Mon Jun  6 01:38:24 2005 >>> net-analyzer/rrdtool-1.2.6
 Mon Jun  6 01:40:17 2005 >>> net-misc/ntp-4.2.0.20040617-r2
 Mon Jun  6 01:41:10 2005 >>> media-libs/sdl-mixer-1.2.6 

I have tried re-emerging pypanel and python-xlib but that didn't fix the problem.

Reproducible: Always
Steps to Reproduce:
1. open an xterm
2. pypanel &
3.

Actual Results:  
/usr/lib/python2.3/site-packages/Xlib/display.py:30: DeprecationWarning:
Non-ASCII character '\xf6' in file
/usr/lib/python2.3/site-packages/Xlib/protocol/display.py on line 749, but no
encoding declared; see http://www.python.org/peps/pep-0263.html for details
  import protocol.display
Traceback (most recent call last):
  File "/usr/bin/pypanel", line 923, in ?
    PyPanel(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 122, 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

Expected Results:  
Pypanel runs.

Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r9 i686)
=================================================================
System uname: 2.6.11-gentoo-r9 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz
Gentoo Base System version 1.6.12
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 27 2005, 13:55:53)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.9.5, 1.7.9-r1, 1.6.3, 1.5, 1.4_p6, 1.8.5-r3
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X acl alsa apm avi bash-completion berkdb bitmap-fonts cdr crypt cups
curl dts dvd dvdr emboss encode flac foomaticdb fortran gd gdbm gif gpm gtk gtk2
imagemagick imlib java jpeg libg++ libwww mad mailwrapper matroska mikmod mmx
motif mozilla mp3 mpeg ncurses network nls nptl ogg oggvorbis opengl oss pam
pdflib perl png python quicktime readline rtc sdl slang spell sse sse2 ssl svg
svga tcpd tetex tiff truetype truetype-fonts type1-fonts vorbis xine xml xml2 xv
xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Zaid A. 2005-06-15 12:16:13 UTC
I found the following on the forums, it seems its not a bug with pypanel
exactly, but more like a bug in python-xlib, but if a dev could confirm this and
maybe propose a fix (beside increasing the buffer size which seems like a
temporarily hack), that'd be great.

http://forums.gentoo.org/viewtopic-t-277512-highlight-pypanel.html
Comment 2 Jonathan Smith (RETIRED) gentoo-dev 2005-06-19 16:02:38 UTC
pypanel is desktop-misc
Comment 3 Jonathan Smith (RETIRED) gentoo-dev 2005-06-22 16:46:54 UTC
the forums post indicates that the problem is with python itself, but i can't
reproduce it at all... it works fine for me

maybe someone from python can help?
Comment 4 Zaid A. 2005-06-25 15:56:56 UTC
Hi Jonathan, 
I'm sorry I wasn't clear when I posted the link, one of the posters in that
thread indicated that the problem is with python-xlib and said that the quick
fix for the problem is by increasing the buffer size from 2048 to 4096.
this is the relevant post by bysse from that thread:

"I've had the same problem... And found a solution, it's a bug in python-xlib.
Also i've tried to contact the devs at sourceforge without any result.

To realy fix this, you need to modify the loop so it receives all data, but if
you're lazy (like me)
you just increase the buffer :)

Code:
#cat pyx-displaypatch
530c530
<                       recv = self.socket.recv(2048)
---
>                       recv = self.socket.recv(4096)


Patch by running:
Code:

patch /usr/lib/python2.3/site-packages/Xlib/protocol/display.py pyx-displaypatch"

I'm not sure what triggered the problem here out of a sudden, everything else
related to python is working fine as far as I can tell.
If there is no other way than increasing the buffer size then I'll do it, but it
seems more like a workaround than a fix.
If you have any suggestions on how to fix this, it'd be great.
Thanks,

Zaid
Comment 5 Jonathan Smith (RETIRED) gentoo-dev 2005-07-01 19:04:53 UTC
since i can't reproduce this problem anyway, does version 2.4 fix the it?
Comment 6 Zaid A. 2005-07-01 23:12:41 UTC
pypanel-2.4 is not working either, when I run it from the console I get this:

/usr/lib/python2.3/site-packages/Xlib/display.py:30: DeprecationWarning:
Non-ASCII character '\xf6' in file
/usr/lib/python2.3/site-packages/Xlib/protocol/display.py on line 749, but no
encoding declared; see http://www.python.org/peps/pep-0263.html for details
  import protocol.display
Traceback (most recent call last):
  File "/usr/bin/pypanel", line 957, in ?
    PyPanel(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 122, 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

any suggestions on how to fix this? I'm not running any bleeding edge packages
or any excessive CFLAGS, I dont have have accept ~x86 system-wide either, if it
would help, I'd post my package.keywords entries.

Zaid
Comment 7 Zaid A. 2005-07-01 23:23:03 UTC
I found this link on pypanel's forums:
http://sourceforge.net/forum/forum.php?thread_id=1299994&forum_id=311693

One of the dev's there suggested to change the buffer size too,in
/usr/lib/python<version>/site-packages/Xlib/protocol/display.py to 4096 instead
of 2048 and doing this gets pypanel to work.

should this bug be marked as fixed? and would it be possible for a dev could
look at python-xlib?

Thanks again for all the help.

Zaid
Comment 8 Jonathan Smith (RETIRED) gentoo-dev 2005-07-02 17:56:17 UTC
since the bug is in python-xlib, this is not our bug
Comment 9 Lukasz Strzygowski (RETIRED) gentoo-dev 2006-02-08 13:11:58 UTC
It should be fixed in python-xlib-0.12-r2. However, I couldn't reproduce this bug so please reopen if it still doesn't work.
Comment 10 wrdaniel 2007-02-17 22:32:42 UTC
(In reply to comment #9)
> It should be fixed in python-xlib-0.12-r2. However, I couldn't reproduce this
> bug so please reopen if it still doesn't work.
> 

looks like the problem is back again. the patch in r2 changed the bufferzize from "2048" to "4096". in another forum from "arch linux" i saw the same fix dated mid 2005. today it seems that 4096 is not enough. i changed it on my machine to 32768 and pypanel works again. 
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2007-03-08 09:24:10 UTC
*** Bug 169900 has been marked as a duplicate of this bug. ***
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2007-03-08 09:27:33 UTC
Someone try w/ python-xlib-0.13...
Comment 13 Volker Wegert 2007-04-14 09:06:28 UTC
I can reproduce this error on a newly installed system with python-xlib-0.12-r1. Using 0.12-r3 (currently in ~x86) seems to fix the problem though.
Comment 14 Santiago M. Mola (RETIRED) gentoo-dev 2007-06-30 14:31:43 UTC
(In reply to comment #13)
> I can reproduce this error on a newly installed system with
> python-xlib-0.12-r1. Using 0.12-r3 (currently in ~x86) seems to fix the problem
> though.
> 

The buffer size patch is being applied since python-xlib-0.12-r2.
-r3 is stable and already have same keywords as -r1. So this bug is solved, Isn't it? Maybe the only thing remaining is removing -r1.
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2007-06-30 23:02:19 UTC
0.12-r3 stable -> closed.