get_full_property() throws exceptions

Bug #1231453 reported by Xu Zhen
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
python-xlib (Ubuntu)
Fix Released
Undecided
Marc Deslauriers

Bug Description

with 0.14+20091101-1, the test.py works well.
$ python test.py
Xlib.protocol.request.QueryExtension
_NET_SUPPORTED is supported
False
_NET_WM_NAME is not supported
True

but with 0.14+20091101-1ubuntu1, it will throw exceptions
$ # python2
$ python test.py
<class 'Xlib.protocol.request.QueryExtension'>
_NET_SUPPORTED is supported
Traceback (most recent call last):
  File "test.py", line 16, in <module>
    print (root.get_full_property(atom, 0) == None)
  File "/usr/lib/python2.7/dist-packages/Xlib/xobject/drawable.py", line 457, in get_full_property
    prop.bytes_after // 4) + 1
TypeError: unsupported operand type(s) for +: 'GetProperty' and 'int'
_NET_WM_NAME is not supported
Traceback (most recent call last):
  File "test.py", line 27, in <module>
    print (root.get_full_property(atom, 0) == None)
  File "/usr/lib/python2.7/dist-packages/Xlib/xobject/drawable.py", line 452, in get_full_property
    prop = self.get_property(property, type, 0, sizehint)
  File "/usr/lib/python2.7/dist-packages/Xlib/xobject/drawable.py", line 441, in get_property
    long_length = length)
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1477, in __init__
    self.reply()
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1489, in reply
    self._display.send_and_recv(request = self._serial)
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/display.py", line 556, in send_and_recv
    gotreq = self.parse_response(request)
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/display.py", line 643, in parse_response
    gotreq = self.parse_request_response(request) or gotreq
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/display.py", line 729, in parse_request_response
    req._parse_response(self.data_recv[:self.request_length])
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 1501, in _parse_response
    self._data, d = self._reply.parse_binary(data, self._display, rawdict = 1)
  File "<string>", line 8, in parse_binary
  File "/usr/lib/python2.7/dist-packages/Xlib/protocol/rq.py", line 647, in parse_binary_value
    if type(ret[1]) is bytes:
TypeError: 'NoneType' object has no attribute '__getitem__'

$ # python3
$ python3 test.py
<class 'Xlib.protocol.request.QueryExtension'>
_NET_SUPPORTED is supported
Traceback (most recent call last):
  File "test.py", line 16, in <module>
    print (root.get_full_property(atom, 0) == None)
  File "/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py", line 457, in get_full_property
    prop.bytes_after // 4) + 1
TypeError: unsupported operand type(s) for +: 'GetProperty' and 'int'
_NET_WM_NAME is not supported
Traceback (most recent call last):
  File "test.py", line 27, in <module>
    print (root.get_full_property(atom, 0) == None)
  File "/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py", line 452, in get_full_property
    prop = self.get_property(property, type, 0, sizehint)
  File "/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py", line 441, in get_property
    long_length = length)
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 1477, in __init__
    self.reply()
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 1489, in reply
    self._display.send_and_recv(request = self._serial)
  File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 556, in send_and_recv
    gotreq = self.parse_response(request)
  File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 643, in parse_response
    gotreq = self.parse_request_response(request) or gotreq
  File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 729, in parse_request_response
    req._parse_response(self.data_recv[:self.request_length])
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 1501, in _parse_response
    self._data, d = self._reply.parse_binary(data, self._display, rawdict = 1)
  File "<string>", line 8, in parse_binary
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 647, in parse_binary_value
    if type(ret[1]) is bytes:
TypeError: 'NoneType' object is not subscriptable

Revision history for this message
Xu Zhen (xuzhen666) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-xlib (Ubuntu):
status: New → Confirmed
Changed in python-xlib (Ubuntu):
assignee: nobody → Marc Deslauriers (mdeslaur)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-xlib - 0.14+20091101-1ubuntu2

---------------
python-xlib (0.14+20091101-1ubuntu2) saucy; urgency=low

  * debian/patches/python3: updated to fix a couple of porting errors
    resulting in get_full_property() throwing an exception. (LP: #1231453)
 -- Marc Deslauriers <email address hidden> Fri, 11 Oct 2013 14:22:01 -0400

Changed in python-xlib (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.