Your message dated Sat, 30 Sep 2017 21:49:13 +0000
with message-id <[email protected]>
and subject line Bug#876728: fixed in python-xlib 0.14+20091101-6
has caused the Debian Bug report #876728,
regarding UnicodeDecodeError in Xlib/xobject/drawable.py
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
876728: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876728
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-xlib
Severity: important
Tags: patch
X-Debbugs-Cc: [email protected]


Hi,
CC:-ing Andrew Shadura, as he has been the last uploader in debian/changelog of python-xlibs.

recently, in Debian stretch, I started seeing errors like below with my X2Go client implementation pyhoca-gui / pyhoca-cli.

I started porting pyhoca and python-x2go (the underlying module) to Python 3 over the last weekend and realized that in Python 3 the issues did not occur anymore.

However, in Python 2 they persist:

```
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gevent/greenlet.py", line 534, in run
    result = self._run(*self.args, **self.kwargs)
File "/home/mike/MyDocuments/4projects/x2go-upstream/pyhoca-gui/x2go/backends/terminal/plain.py", line 1092, in _find_session_window
    window = utils.find_session_window(self.session_info.name)
File "/home/mike/MyDocuments/4projects/x2go-upstream/pyhoca-gui/x2go/utils.py", line 639, in find_session_window
    name = window.get_wm_name()
File "/usr/lib/python2.7/dist-packages/Xlib/xobject/drawable.py", line 636, in get_wm_name
    d = self.get_full_property(Xatom.WM_NAME, Xatom.STRING)
File "/usr/lib/python2.7/dist-packages/Xlib/xobject/drawable.py", line 458, in get_full_property
    val = val + prop.value
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 29: ordinal not in range(128) <Greenlet at 0x7fa0fb3315f0: <bound method X2GoTerminalSession._find_session_window of <x2go.backends.terminal.plain.X2GoTerminalSession object at 0x7fa0f9490410>>(timeout=60)> failed with UnicodeDecodeError
```

The underlying cause for this issue is in Xlib/protocol/rq.py. The patch below fixes the issue:

The patch gets applied in String8.parse_binary_value().

```
--- rq.py       2015-08-25 17:58:11.000000000 +0200
+++ rq.py.fixed 2017-09-25 12:18:58.172941197 +0200
@@ -415,8 +415,14 @@
             s = s.decode('UTF-8')
         except UnicodeDecodeError:
             pass  # return as bytes
-        return s, data[slen:]

+        d = data[slen:]
+        try:
+            d = d.decode('UTF-8')
+        except UnicodeDecodeError:
+            pass
+
+        return s, d

```

Without the above patch, sometimes <str> types get returned, sometime <unicode> types. With the above patch, everything is returned as <unicode>.

Ideally, this fix should also go into Debian stretch. Thanks!

As no real persons seems to be maintaining the python-xlib package (no Uploaders: field), nor has it been orphaned, I'll consider fixing the above issue myself as an NMU or team upload (unless someone replies to my report).

I'd be really happy about a second pair of eyes to look at this issue, before I upload this.

Thanks!

Mike

--

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
mobile: +49 (1520) 1976 148
landline: +49 (4354) 8390 139

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: [email protected], http://das-netzwerkteam.de

Attachment: pgpzxH2GjkGcS.pgp
Description: Digitale PGP-Signatur


--- End Message ---
--- Begin Message ---
Source: python-xlib
Source-Version: 0.14+20091101-6

We believe that the bug you reported is fixed in the latest version of
python-xlib, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andrew Shadura <[email protected]> (supplier of updated python-xlib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 25 Sep 2017 12:47:31 +0200
Source: python-xlib
Binary: python-xlib python3-xlib
Architecture: source
Version: 0.14+20091101-6
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Modules Team 
<[email protected]>
Changed-By: Andrew Shadura <[email protected]>
Description:
 python-xlib - interface for Python to the X11 protocol
 python3-xlib - interface for Python 3 to the X11 protocol
Closes: 876728
Changes:
 python-xlib (0.14+20091101-6) unstable; urgency=medium
 .
   * Apply a patch from Mike Gabriel to fix UnicodeDecodeError in
     Xlib/xobject/drawable.py (Closes: #876728)
Checksums-Sha1:
 54ed9b776355c158d91aef4191c7533cb3194b68 1897 python-xlib_0.14+20091101-6.dsc
 7a2c18080ff0bdca9e456c7d178652b7230da4d6 54908 
python-xlib_0.14+20091101-6.debian.tar.xz
Checksums-Sha256:
 7524219a231ec2dd368a5cbe7d503e3408ca06b6ecf004529724aae349f4b535 1897 
python-xlib_0.14+20091101-6.dsc
 f5445462cc4e794271fb9ddfb6a77e205663d655a5e89f0f7adcceda6842948a 54908 
python-xlib_0.14+20091101-6.debian.tar.xz
Files:
 df632e8512da4a6b9bae35901ffbca51 1897 python optional 
python-xlib_0.14+20091101-6.dsc
 819ae34cc86102fac486a0b16b681e4d 54908 python optional 
python-xlib_0.14+20091101-6.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCAAGBQJZyN8vAAoJEJ1bI/kYT6UUS+gIAJM6dAtW/35EKngZtkmpKyQs
Nhk5XyFZggSeM+JERRQp/0js0QRzrBgjaob1wuX7ZRz6VuOUqx/iwEmnXjEW1JHE
zo6ZFJBnkFdf7QISwtEMF25qg8hBEaVj/JhCMgT0dUSF59v60dqDAjh+CPYI2NTs
otTtvRdrAUT9FgA4z63xyVJKtm6WAv72fc8G7sEtveDoVB2wUvPW5crLA3qVS5tu
FbdzuHCVzpfsCREZftI1bYPXOzrIS8FqzfCYjMHbSUAJVy/ZK6y05g6XtjWNg3wi
Kz2cRrGOqlQJWu0nyoL+dGlNloBU420t/t6cpiarfYTpvom7Xm7r6p6hPugnEqs=
=h4Sn
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to