[Fedora-livecd-list] Patch for unicode error messages
Felix Schwarz
felix.schwarz at oss.schwarz.eu
Sat Feb 7 11:01:30 UTC 2009
Hi,
when I tried to build a custom live cd I noticed some problems in the error
reporting when there were unicode error messages (e.g. some dependency was
missing).
Example:
...
> anaconda-11.4.1.63-1.i386 von updates hat Abhängigkeitsauflöse-Probleme
> --> Fehlende Abhängigkeit: booty wird benötigt von Paket anaconda-11.4.1.63-1.i386 (updates)
> Traceback (most recent call last):
> File "./tools/livecd-creator", line 140, in <module>
> sys.exit(main())
> File "./tools/livecd-creator", line 132, in main
> logging.error("Error creating Live CD : %s" % e)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 42: ordinal not in range(128)
My patch ensures that unicode error messages can be printed correctly every
time. To get 100% unicode support, one should go through all log calls and
ensure that all strings are unicode so that localized error messages are
always shown correctly.
With my patch, there should be no unicode exceptions anymore, even when the
error message may be printed as 'Fehlende Abh\xe4ngigkeit' instead of
'Fehlende Abhängigkeit' (notice the '\xe4' in the first string).
fs
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unicode_errors.patch
URL: <http://listman.redhat.com/archives/fedora-livecd-list/attachments/20090207/b6c19c41/attachment.ksh>
More information about the Fedora-livecd-list
mailing list