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

David Shea dshea at redhat.com
Thu Sep 12 19:57:17 UTC 2013


On 09/12/2013 12:01 PM, David Shea wrote:
> 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
>   
We might be able to remove that whole block soon. Libxklavier claims 
that they fixed the string types in 5.4.


More information about the anaconda-patches mailing list