ssokolow / quicktile

Adds window-tiling hotkeys to any X11 desktop. (An analogue to WinSplit Revolution for people who don't want to use Compiz Grid)
https://ssokolow.com/quicktile/
GNU General Public License v2.0
861 stars 78 forks source link

quicktile.py crash after Ubuntu 14.04 python-xlib upgrade #61

Closed jmrohwer closed 8 years ago

jmrohwer commented 8 years ago

Ubuntu 14.04 recently upgraded the python-xlib package. This caused quicktile to stop working, with the following traceback:

jr@bc433789:~ $ quicktile.py -d
Traceback (most recent call last):
  File "/home/jr/bin/quicktile.py", line 1267, in <module>
    if not app.run():
  File "/home/jr/bin/quicktile.py", line 919, in run
    self.keybinder = KeyBinder()
  File "/home/jr/bin/quicktile.py", line 752, in __init__
    self.xdisp = xdisplay or Display()
  File "/usr/lib/python2.7/dist-packages/Xlib/display.py", line 80, in __init__
    self.display = _BaseDisplay(display)
  File "/usr/lib/python2.7/dist-packages/Xlib/display.py", line 62, in __init__
    display.Display.__init__(*(self, ) + args, **keys)
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/display.py", line 61, in __init__
    name, host, displayno)
  File "/usr/lib/python2.7/dist-packages/Xlib/support/connect.py", line 93, in get_auth
    return getattr(mod, modname).get_auth(sock, dname, host, dno)
  File "/usr/lib/python2.7/dist-packages/Xlib/support/unix_connect.py", line 116, in new_get_auth
    au = xauth.Xauthority()
  File "/usr/lib/python2.7/dist-packages/Xlib/xauth.py", line 84, in __init__
    self.entries.append((family, addr.decode('UTF-8'),
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc0 in position 0: invalid start byte

The changelog from the ubuntu package manager reads:

python-xlib (0.14+20091101-1ubuntu3~trusty) trusty; urgency=medium

  • Upload fix to trusty as well (lp: #1482844) [ Marc Deslauriers ]
  • debian/patches/lp1432889.patch: properly decode the xauthority file into strings instead of byte arrays in Xlib/xauth.py.

    -- Sebastien Bacher seb128@ubuntu.com Tue, 10 Nov 2015 11:46:01 +0100

Seems to have to do with the parsing of the .Xauthority file. My knowledge of this is insufficient to debug this. Downgrading python-xlib "solves" the problem, but is not desirable for obvious reasons. Is this a known issue?

ssokolow commented 8 years ago

Something about your desktop has python-xlib broken for every application that uses it (not just QuickTile). See #58 for a solution that worked for someone else.

I really need to add this to the FAQ.

ssokolow commented 8 years ago

On second thought, the FAQ is really only an appropriate place for things where QuickTile itself can't display a helpful message (eg. no reaction when there should be one), so I instead updated QuickTile to display a helpful error message.