From: David Simmons <simmons@da...> - 2009-11-01 23:31:12
First of all, many thanks for a great library.
It looks like python-xlib fails when an .Xauthority file is not present.
I.e., when I'm connecting to a remote X server which has granted me
access via xhost. This happens in python-xlib-0.14/Xlib/xauth.py in the
two places where error.XauthError is raised.
It seems to me that perhaps the absence of an .Xauthority file should be
treated as "no xauth information found," just as if the display was not
found in an existing file. (I suppose the downside might be some
confusion if xauth information was silently passed over due to
permissions problems or some such.) Anyway, my quick fix to my local
copy was to do the following:
--- python-xlib-0.14/Xlib/support/unix_connect.py.orig 2008-08-27
+++ python-xlib-0.14/Xlib/support/unix_connect.py 2009-11-01
@@ -99,7 +99,12 @@
family = xauth.FamilyLocal
addr = socket.gethostname()
- au = xauth.Xauthority()
+ au = xauth.Xauthority()
+ except error.XauthError:
+ # no xauth information is available
+ return '', ''
return au.get_best_auth(family, addr, dno)
Get latest updates about Open Source Projects, Conferences and News.