Public bug reported:

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

** Affects: python-xlib (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "test.py"
   https://bugs.launchpad.net/bugs/1231453/+attachment/3842293/+files/test.py

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1231453

Title:
  get_full_property() throws exceptions

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-xlib/+bug/1231453/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to