This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 876293 - UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 56: ordinal not in range(128)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 56: ordi...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: pykickstart (Show other bugs)
18
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Vratislav Podzimek
Fedora Extras Quality Assurance
abrt_hash:15cf01368343ae149bb9964133a...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-13 13:36 EST by Steve Tyler
Modified: 2013-04-10 10:37 EDT (History)
9 users (show)

See Also:
Fixed In Version: 1.99.23-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-04-10 10:37:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: anaconda-tb (1.77 MB, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: environ (876 bytes, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: type (9 bytes, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: ifcfg.log (2.61 KB, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: storage.log (1.89 MB, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: version (2 bytes, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: program.log (858.71 KB, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: executable (14 bytes, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: product (6 bytes, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: anaconda.log (126.95 KB, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: hashmarkername (8 bytes, text/plain)
2012-11-13 13:36 EST, Steve Tyler
no flags Details
File: packaging.log (142 bytes, text/plain)
2012-11-13 13:37 EST, Steve Tyler
no flags Details
File: cmdline_file (162 bytes, text/plain)
2012-11-13 13:37 EST, Steve Tyler
no flags Details
File: release (33 bytes, text/plain)
2012-11-13 13:37 EST, Steve Tyler
no flags Details
File: messages (440.13 KB, text/plain)
2012-11-13 13:37 EST, Steve Tyler
no flags Details
File: other involved packages (67 bytes, text/plain)
2012-11-13 13:37 EST, Steve Tyler
no flags Details
screenshot showing NTP configuration dialog after adding '中文 (台湾)' as a server name (204.04 KB, image/png)
2012-11-14 04:01 EST, Steve Tyler
no flags Details

  None (edit)
Description Steve Tyler 2012-11-13 13:36:23 EST
Description of problem:
Test install with zh_TW.

Version-Release number of selected component:
anaconda-18.29-1.fc18.x86_64

Additional info:
libreport version: 2.0.17
cmdline:        /usr/bin/python  /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-osimg-min --lang en_US.UTF-8
kernel:         3.6.6-3.fc18.x86_64

description:
: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
:    f.write(str(ksdata))
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/install.py", line 86, in doConfiguration
:    _writeKS(ksdata)
:  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)
Comment 1 Steve Tyler 2012-11-13 13:36:31 EST
Created attachment 644304 [details]
File: anaconda-tb
Comment 2 Steve Tyler 2012-11-13 13:36:33 EST
Created attachment 644305 [details]
File: environ
Comment 3 Steve Tyler 2012-11-13 13:36:34 EST
Created attachment 644306 [details]
File: type
Comment 4 Steve Tyler 2012-11-13 13:36:35 EST
Created attachment 644307 [details]
File: ifcfg.log
Comment 5 Steve Tyler 2012-11-13 13:36:42 EST
Created attachment 644308 [details]
File: storage.log
Comment 6 Steve Tyler 2012-11-13 13:36:44 EST
Created attachment 644309 [details]
File: version
Comment 7 Steve Tyler 2012-11-13 13:36:48 EST
Created attachment 644310 [details]
File: program.log
Comment 8 Steve Tyler 2012-11-13 13:36:49 EST
Created attachment 644311 [details]
File: executable
Comment 9 Steve Tyler 2012-11-13 13:36:51 EST
Created attachment 644312 [details]
File: product
Comment 10 Steve Tyler 2012-11-13 13:36:53 EST
Created attachment 644313 [details]
File: anaconda.log
Comment 11 Steve Tyler 2012-11-13 13:36:58 EST
Created attachment 644315 [details]
File: hashmarkername
Comment 12 Steve Tyler 2012-11-13 13:37:00 EST
Created attachment 644316 [details]
File: packaging.log
Comment 13 Steve Tyler 2012-11-13 13:37:02 EST
Created attachment 644317 [details]
File: cmdline_file
Comment 14 Steve Tyler 2012-11-13 13:37:03 EST
Created attachment 644318 [details]
File: release
Comment 15 Steve Tyler 2012-11-13 13:37:07 EST
Created attachment 644319 [details]
File: messages
Comment 16 Steve Tyler 2012-11-13 13:37:09 EST
Created attachment 644320 [details]
File: other involved packages
Comment 17 Steve Tyler 2012-11-14 03:49:05 EST
Attempt to reproduce Bug 876293.

Package: anaconda-18.29-1.fc18.x86_64
OS Release: Fedora release 18
Comment 18 Steve Tyler 2012-11-14 04:01:15 EST
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.[1]
Click '+' to add.
Uncheck the ntp.org entries. (See attached screenshot.)
Click 'O' to save.
Click Done.
Configure disk:
    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.)

[1] The Chinese characters are copied from:
>>> import babel
>>> print babel.Locale.parse('zh_TW').display_name
中文 (台湾)
Comment 19 Steve Tyler 2012-11-14 04:28:34 EST
This can also be reproduced by installing in English and entering '中文 (台湾)' as an NTP server.
Comment 20 Steve Tyler 2012-11-14 12:44:00 EST
See also Bug 865869 re input validation.
Comment 21 Steve Tyler 2012-11-14 14:06:35 EST
I couldn't find an actual NTP server with non-ASCII characters in its name, so I made one up that is a reproducer: :-)

españa.ntp.org

Stratum One Time Servers
http://support.ntp.org/bin/view/Servers/StratumOneTimeServers

Stratum Two Time Servers
http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers
Comment 22 Vratislav Podzimek 2012-11-15 07:56:15 EST
This is not only an issue of NTP servers and should be resolved in a general way.
Comment 23 Vratislav Podzimek 2012-11-30 06:29:12 EST
(In reply to comment #22)
> This is not only an issue of NTP servers and should be resolved in a general
> way.
This is a problem in pykickstart itself. I've changed the component and sent a patch to anaconda-patches.
Comment 24 Steve Tyler 2012-11-30 13:28:46 EST
[pykickstart] [PATCH] Beware of possibly unicode strings (#876293)
https://lists.fedorahosted.org/pipermail/anaconda-patches/2012-November/002272.html

Thanks.

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?
Comment 25 Vratislav Podzimek 2012-12-03 02:18:09 EST
(In reply to comment #24)
> [pykickstart] [PATCH] Beware of possibly unicode strings (#876293)
> https://lists.fedorahosted.org/pipermail/anaconda-patches/2012-November/
> 002272.html
> 
> Thanks.
> 
> 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 [1], 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.
Comment 26 Vratislav Podzimek 2012-12-03 02:18:52 EST
[1] http://docs.python.org/3.0/howto/unicode.html#the-string-type

Note You need to log in before you can comment on or make changes to this bug.