[PATCH 1/2] Fix the handling of xklavier strings.

David Shea dshea at redhat.com
Thu Sep 12 16:01:17 UTC 2013


Sometimes the array of character values uses signed bytes.
---
 pyanaconda/keyboard.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index 5b1643c..ee876a0 100644
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -36,6 +36,7 @@ import types
 import os
 import re
 import shutil
+import ctypes
 
 from pyanaconda import iutil
 from pyanaconda import flags
@@ -333,7 +334,7 @@ def item_str(s):
     elif type(s) == types.ListType:
         # XXX: this is the wrong case that should be fixed (rhbz#920595)
         i = s.index(0)
-        s = "".join(chr(char) for char in s[:i] if char in xrange(256))
+        s = "".join(chr(ctypes.c_uint8(char).value) for char in s[:i])
 
     return s.decode("utf-8") #there are some non-ascii layout descriptions
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list