Red Hat Bugzilla – Bug 876293
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 56: ordinal not in range(128)
Last modified: 2013-04-10 10:37:48 EDT
Description of problem:
Test install with zh_TW.
Version-Release number of selected component:
libreport version: 2.0.17
cmdline: /usr/bin/python /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-osimg-min --lang en_US.UTF-8
:The following was filed automatically by anaconda:
:anaconda 18.29 exception report
:Traceback (most recent call first):
: File "/usr/lib/python2.7/site-packages/pykickstart/base.py", line 284, in __str__
: retval += obj.__str__()
: File "/usr/lib64/python2.7/site-packages/pyanaconda/install.py", line 47, in _writeKS
: File "/usr/lib64/python2.7/site-packages/pyanaconda/install.py", line 86, in doConfiguration
: File "/usr/lib64/python2.7/threading.py", line 504, in run
: self.__target(*self.__args, **self.__kwargs)
: File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 91, in run
: threading.Thread.run(self, *args, **kwargs)
:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 56: ordinal not in range(128)
Created attachment 644304 [details]
Created attachment 644305 [details]
Created attachment 644306 [details]
Created attachment 644307 [details]
Created attachment 644308 [details]
Created attachment 644309 [details]
Created attachment 644310 [details]
Created attachment 644311 [details]
Created attachment 644312 [details]
Created attachment 644313 [details]
Created attachment 644315 [details]
Created attachment 644316 [details]
Created attachment 644317 [details]
Created attachment 644318 [details]
Created attachment 644319 [details]
Created attachment 644320 [details]
File: other involved packages
Attempt to reproduce Bug 876293.
OS Release: Fedora release 18
Created attachment 644677 [details]
screenshot showing NTP configuration dialog after adding '中文 (台湾)' as a server name
Here is a detailed reproducer:
Choose 'Chinese (Taiwan)' for the install language.
Click Date & Time.
Click gear icon to configure NTP.
Enter '中文 (台湾)' in the text box.
Click '+' to add.
Uncheck the ntp.org entries. (See attached screenshot.)
Click 'O' to save.
Delete all preexisting partitions.
Auto-create partitions and filesystems.
Click Begin Installation.
Set root password.
Exception occurs while running post install scripts.
(The installer may appear to hang.)
 The Chinese characters are copied from:
>>> import babel
>>> print babel.Locale.parse('zh_TW').display_name
This can also be reproduced by installing in English and entering '中文 (台湾)' as an NTP server.
See also Bug 865869 re input validation.
I couldn't find an actual NTP server with non-ASCII characters in its name, so I made one up that is a reproducer: :-)
Stratum One Time Servers
Stratum Two Time Servers
This is not only an issue of NTP servers and should be resolved in a general way.
(In reply to comment #22)
> This is not only an issue of NTP servers and should be resolved in a general
This is a problem in pykickstart itself. I've changed the component and sent a patch to anaconda-patches.
[pykickstart] [PATCH] Beware of possibly unicode strings (#876293)
This is basically a type-conversion problem. Isn't there a way to get Python to do the type conversion automatically, so we don't have to keep finding and fixing bugs like this?
(In reply to comment #24)
> [pykickstart] [PATCH] Beware of possibly unicode strings (#876293)
> This is basically a type-conversion problem. Isn't there a way to get Python
> to do the type conversion automatically, so we don't have to keep finding
> and fixing bugs like this?
I don't know about any such way. Python3 helps with that , but in Python 2.X one has to do the conversions and use unicode strings or utf8-encoded byte strings consistently. This is a bit difficult when Anaconda uses so many different tools returning us strings. Thus I'm afraid we are just going to keep fixing bugs like this, at least until we switch to Python3.