record_demo.py in the examples directory, and thus the program Selfspy which relies on the same feature, is broken. See this issue: https://github.com/gurgeh/selfspy/issues/29 I belive that the culprit is a commit two weeks ago, with revision number 158, which changed something with validation. Either that or the demo shiould be changed to remove the : False -entries in the dictionary.
With revision 158:
> python record_demo.py
RECORD extension version 1.13
Traceback (most recent call last):
File "/home/gurgeh/Downloads/record_demo.py", line 98, in <module>
'client_died': False,
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/ext/record.py", line 121, in create_context
ranges = ranges)
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 1403, in __init__
self._binary = apply(self._request.to_binary, args, keys)
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 1088, in to_binary
return apply(self.to_binary, varargs, keys)
File "<string>", line 3, in to_binary
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 523, in pack_value
data.append(self.type.pack_value(v))
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 1102, in pack_value
return apply(self.to_binary, (), value)
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 1088, in to_binary
return apply(self.to_binary, varargs, keys)
File "<string>", line 4, in to_binary
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 573, in check_value
vals.append(f.check_value(val[i]))
File "/home/gurgeh/.virtualenvs/xlibtest/local/lib/python2.7/site-packages/Xlib/protocol/rq.py", line 582, in check_value
raise TypeError('Object value must be tuple, dictionary or DictWrapper: %s' % val)
TypeError: Object value must be tuple, dictionary or DictWrapper: 0
with the tagged 0.15rc1 (rev 137 or something), the program works.