Won't run on Ubuntu 12.10 #29

Closed
Deradon opened this Issue Dec 1, 2012 · 5 comments

Comments

Projects
None yet
2 participants

Deradon commented Dec 1, 2012

I can't get selfspy to run on my machine (Ubuntu 12.10)

$ ls -l ~/.selfspy     
# Empty Directory

$ ./selfspy.py --password foobar
RECORD extension present
Traceback (most recent call last):
  File "./selfspy.py", line 122, in <module>
    astore.run()
  File "/home/deradon/Dev/Github/selfspy/activity_store.py", line 94, in run
    self.sniffer.run()
  File "/home/deradon/Dev/Github/selfspy/sniff_x.py", line 78, in run
    'client_died': False,
  File "/usr/local/lib/python2.7/dist-packages/Xlib/ext/record.py", line 121, in create_context
    ranges = ranges)
  File "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1403, in __init__
    self._binary = apply(self._request.to_binary, args, keys)
  File "/usr/local/lib/python2.7/dist-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 "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 523, in pack_value
    data.append(self.type.pack_value(v))
  File "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1102, in pack_value
    return apply(self.to_binary, (), value)
  File "/usr/local/lib/python2.7/dist-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 "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 573, in check_value
    vals.append(f.check_value(val[i]))
  File "/usr/local/lib/python2.7/dist-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

$ ls -l ~/.selfspy     
* password.digest
* selfspy.sqlite

$ python --version
=> Python 2.7.3
Collaborator

gurgeh commented Dec 3, 2012

That is odd. I run it from Ubuntu 12.10 myself. I assume that you have X installed? What version of python-xlib do you run (run "find /usr -name 'python_xlib-*.egg-info' " )? It should be 0.14. How did you install selfspy? Through the (broken) PPA or manually with "pip install requirements"?

Can you run this example program from python-xlib?
http://python-xlib.svn.sourceforge.net/viewvc/python-xlib/trunk/examples/record_demo.py?revision=158&view=markup
It contains more or less the exact same line that you get a traceback for.

Deradon commented Dec 3, 2012

I installed selfspy first via git clone + pip install requirements.
After this, I tried with PPA.
In both cases, I got the same error.

$ find /usr -name 'python_xlib-*.egg-info'

/usr/share/pyshared/python_xlib-0.14.egg-info
/usr/lib/pymodules/python2.7/python_xlib-0.14.egg-info
/usr/local/lib/python2.7/dist-packages/python_xlib-0.15rc1.egg-info
$ python record_demo.py 

RECORD extension version 1.13
Traceback (most recent call last):
  File "record_demo.py", line 98, in <module>
    'client_died': False,
  File "/usr/local/lib/python2.7/dist-packages/Xlib/ext/record.py", line 121, in create_context
    ranges = ranges)
  File "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1403, in __init__
    self._binary = apply(self._request.to_binary, args, keys)
  File "/usr/local/lib/python2.7/dist-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 "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 523, in pack_value
    data.append(self.type.pack_value(v))
  File "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1102, in pack_value
    return apply(self.to_binary, (), value)
  File "/usr/local/lib/python2.7/dist-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 "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 573, in check_value
    vals.append(f.check_value(val[i]))
  File "/usr/local/lib/python2.7/dist-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
Collaborator

gurgeh commented Dec 3, 2012

I suspect that the python-xlib that is used is the one with version 0.15-rc1 in your dist-packages. I didn't even know 0.15 existed. Remove it or move it away (the /usr/local/lib/python2.7/dist-packages/Xlib directory) and try again.

Deradon commented Dec 3, 2012

Ok, removing the /usr/local/lib/python2.7/dist-packages/Xlib works.
Selfspy is starting now.

./selfspy.py 
Password: 
Xlib.protocol.request.QueryExtension
Xlib.protocol.request.QueryExtension
RECORD extension present
./selfstats.py 
<RowID> <Starting date and time> <Duration> <Process> <Window title> <Number of keys pressed>
1 2012-12-03 10:59:01.393494 9s Gnome-terminal "./selfspy.py" 1
2 2012-12-03 10:59:10.457788 6s Gnome-terminal "deradon@deradon-HP-Pavilion-g6: ~/.selfspy" 13
3 2012-12-03 10:59:16.743380 5s Gnome-terminal "deradon@deradon-HP-Pavilion-g6: ~" 13
4 2012-12-03 10:59:21.891612 3s Gnome-terminal "deradon@deradon-HP-Pavilion-g6: ~/Dev/Github/selfspy" 8
4 rows
Collaborator

gurgeh commented Dec 3, 2012

I have looked into it now and it seems that 0.15rc1 is an OK version in general. The problem is a python-xlib commit two weeks ago that breaks selfspy (and their own example, which makes it a bug, I think). I have changed the requirements.txt to point to a specific release, which should make sure that others get the correct version.

If they have public bug tracking, I will report the issue to them.

Thanks for reporting the issue!

@gurgeh gurgeh closed this Dec 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment