Apply a patch from Mike Gabriel to fix UnicodeDecodeError in Xlib/xobject/drawable.py

Closes: #876728
parent 7691a04a
From 7691a04a3e5bf4539c886418d7f3e95135066e26 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Mon, 25 Sep 2017 10:31:02 +0000
Subject: [PATCH] Always return unicode from String8.parse_binary_value().
---
Xlib/protocol/rq.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Xlib/protocol/rq.py b/Xlib/protocol/rq.py
index 9a27eba..4535b4e 100644
--- a/Xlib/protocol/rq.py
+++ b/Xlib/protocol/rq.py
@@ -415,8 +415,14 @@ class String8(ValueField):
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
class String16(ValueField):
structcode = None
--
2.11.0
......@@ -7,3 +7,4 @@ python3.patch
remove-debugging-output.patch
texi2html.patch
fix-auth-lp1482844.patch
fix-unicode-876728.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment