Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

struct.error: ushort format requires 0 <= number <= USHRT_MAX #50

Closed
plejik-zz opened this issue Apr 24, 2015 · 4 comments
Closed

struct.error: ushort format requires 0 <= number <= USHRT_MAX #50

plejik-zz opened this issue Apr 24, 2015 · 4 comments
Assignees
Labels

Comments

@plejik-zz
Copy link

First run setup.py install
Then /usr/local/bin/quicktile.py -d
And have error
Xlib.protocol.request.QueryExtension
Traceback (most recent call last):
File "./quicktile.py", line 1261, in
if not app.run():
File "./quicktile.py", line 918, in run
self.keybinder.bind(self._modmask + key, call)
File "./quicktile.py", line 805, in bind
1, X.GrabModeAsync, X.GrabModeAsync)
File "/usr/lib/pymodules/python2.7/Xlib/xobject/drawable.py", line 558, in grab_key
keyboard_mode = keyboard_mode)
File "/usr/lib/pymodules/python2.7/Xlib/protocol/rq.py", line 1406, in init
self._binary = apply(self._request.to_binary, args, keys)
File "/usr/lib/pymodules/python2.7/Xlib/protocol/rq.py", line 1095, in to_binary
return apply(self.to_binary, varargs, keys)
File "", line 2, in to_binary
struct.error: ushort format requires 0 <= number <= USHRT_MAX
Can someone help with this?

@ssokolow
Copy link
Owner

Wow. That's an interesting one.

What distro are you running and can you pastebin your quicktile.cfg?

@xerebus
Copy link

xerebus commented Jun 19, 2015

Same issue here, on Arch Linux. I tried installing quicktile through the AUR and directly from the version here on GitHub -- the same issue occurs.

[abiswas@kaon ~]$ quicktile -d
Xlib.protocol.request.QueryExtension
Traceback (most recent call last):
  File "/usr/bin/quicktile", line 1261, in <module>
    if not app.run():
  File "/usr/bin/quicktile", line 918, in run
    self.keybinder.bind(self._modmask + key, call)
  File "/usr/bin/quicktile", line 805, in bind
    1, X.GrabModeAsync, X.GrabModeAsync)
  File "/usr/lib/python2.7/site-packages/Xlib/xobject/drawable.py", line 558, in grab_key
    keyboard_mode = keyboard_mode)
  File "/usr/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 1406, in __init__
    self._binary = apply(self._request.to_binary, args, keys)
  File "/usr/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 1095, in to_binary
    return apply(self.to_binary, varargs, keys)
  File "<string>", line 2, in to_binary
struct.error: ushort format requires 0 <= number <= USHRT_MAX

And my quicktile.cfg:

[general]
cfg_schema = 1
UseWorkarea = True
ModMask = <Super><Shift>

[keys]
C = move-to-center
G = horizontal-maximize
V = vertical-maximize
A = maximize
N = bottom-left
J = bottom
M = bottom-right
H = left
KP_5 = middle
L = right
U = top-left
K = top
I = top-right
P = monitor-switch

@xerebus
Copy link

xerebus commented Jun 19, 2015

_SOLVED_ (for me at least)

Looks like this was caused by using <Super> instead of <Mod4>, which you warned about in the README as one of the modifiers that "cause QuickTile to error out deep in python-xlib because GTK+ maps them to integers beyond the limits of the X11 wire protocol."

Thanks for the thorough documentation!

@ssokolow
Copy link
Owner

Ahh, that makes sense.

Once I'm no longer bogged down preparing for exams, I'll take another look to see if I can catch that case and display a more helpful error message.

@ssokolow ssokolow self-assigned this Jul 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants