#21 0.13 breaks pypanel

closed-fixed
nobody
None
5
2007-06-10
2006-12-28
Anonymous
No

bradmwalker@cableone.net says:

i'm running python 2.5 and xorg 7.2 RC3 with libX11, mesa, and cairo installed with libxcb support. I use nvidia-drivers-1.0.9631 w/TwinView.

PyPanel works with gentoo's
python-xlib-0.12-r2. when i upgrade to python-xlib-0.13 PyPanel crashes like this:

brad@squirrel ~ $ pypanel
Traceback (most recent call last):
File "/usr/bin/pypanel", line 957, in <module>
PyPanel(display.Display())
File "/usr/lib/python2.5/site-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
File "/usr/lib/python2.5/site-packages/Xlib/display.py", line 67, in __init__
apply(protocol.display.Display.__init__, (self, ) + args, keys)
File "/usr/lib/python2.5/site-packages/Xlib/protocol/display.py", line 121, in __init__
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0.0": No protocol specified

Discussion

  • Mark Diekhans
    Mark Diekhans
    2007-02-07

    Logged In: YES
    user_id=66101
    Originator: NO

    This is some interaction between xlib and python2.5; it's independent of pypanel. The following two lines of code generate this error with python2.5, but not 2.4. Note that setting xhost + prevents the error,
    but one really doesn't want to do this.

    from Xlib import display
    display.Display()

     
  • Logged In: YES
    user_id=68375
    Originator: NO

    I haven't got a Python 2.5 compiled up, so I can't test these hypotheses, but they are at least somewhere to start looking. It seems to be a problem with parsing the .Xauthority file. This is done by Xlib/xauth.py, which is a self-contained piece of code which should rather easily be tested. The only tricky stuff there is some struct.unpack. Alternatively Xlib/support/unix_connect.py can do something wrong when parsing $DISPLAY.

     
  • Mike Grant
    Mike Grant
    2007-02-11

    Logged In: YES
    user_id=1175208
    Originator: NO

    I'm on FC6 (xorg 7.1.1, nvidia 9746) and had a go with a self-compiled python 2.5:
    Python 2.5 (r25:51908, Feb 11 2007, 00:07:32)
    [GCC 4.1.1 20070105 (Red Hat 4.1.1-51)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from Xlib import display
    >>> display.Display()
    <Xlib.display.Display instance at 0xb7eb8e8c>

    I've looked over the display code a bit too and don't see anything obviously wrong (or particularly changed there between 0.12 & 0.13), so I think petli is right to say it's probably in the xauth part. diekhans, what version of X are you running?

     
  • Mark Diekhans
    Mark Diekhans
    2007-02-11

    Logged In: YES
    user_id=66101
    Originator: NO

    I am running XOrg 6.9.0 on FreeBSD
    python info:
    2.5 (r25:51908, Nov 11 2006, 12:14:09)
    [GCC 3.4.6 [FreeBSD] 20060305]

     
  • Mike Grant
    Mike Grant
    2007-02-11

    test version of Xlib/xauth.py

     
    Attachments
  • Mike Grant
    Mike Grant
    2007-02-11

    Logged In: YES
    user_id=1175208
    Originator: NO

    I investigated a bit more and found that under python 2.5, the class in xauth.py silently fails to parse the Xauthority file (doesn't like the use of the buffer object). I've replaced it with simple slices and that seems to work (I get parsed results anyway). I don't know if that'll fix the problems or not, so I've attached a copy of the patched file to this bug. diekhans or bradwalker: could you try dropping it in place of your <python site packages dir>/Xlib/xauth.py file and see if it helps?
    File Added: xauth.py

     
  • Mark Diekhans
    Mark Diekhans
    2007-02-11

    Logged In: YES
    user_id=66101
    Originator: NO

    Works! The update xauth.py fixes the problem, both it the test case and with pypanel.

     
  • Mike Grant
    Mike Grant
    2007-02-11

    Logged In: YES
    user_id=1175208
    Originator: NO

    Great, checked into CVS :) When I get a little bit of time, I'll roll a 0.14 - it'd be nice to get the RECORD extension stuff out there too. I'll leave this bug open until then.

    Thanks for the testing (and the hints, petli) :)

     
  • Mike Grant
    Mike Grant
    2007-06-10

    • status: open --> closed-fixed
     
  • Mike Grant
    Mike Grant
    2007-06-10

    Logged In: YES
    user_id=1175208
    Originator: NO

    0.14rc1 released with this fix - please and reopen this if there's any problems :)