Red Hat Bugzilla – Bug 798323
Unicode characters break CLI when executed from a subshell
Last modified: 2014-09-18 11:32:56 EDT
Description of problem:
Unicode characters can cause UnicodeEncodeError anytime they are printed and the cli is executed from a subshell. More precisely every time python can't guess terminal's encoding. This causes troubles with localised strings.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. katello environment create --name="žluťoučký_kůň" --prior Library --org ACME_Corporation
2. echo "$(kat environment list --org ACME_Corporation)"
3. see following error and the environment not being listed
error: 'ascii' codec can't encode character u'\u017e' in position 0: ordinal not in range(128) (more in the log file)
Error "'ascii' codec can't encode character"
Command should print localised strings normally.
Fixed in katello-cli-0.2.4-1
All string inputs are converted to unicode as soon as possible. If there's no encoding settings forced from outside, utf-8 is set as default for stderr and stdout.
One more update in katello-cli-0.2.5-1
Forgot to change spec file. It should by all finally fixed in katello-cli-0.2.6-1
QA Verified: 0.1.303-1.el6
This fix causes another bug which is described here: https://bugzilla.redhat.com/show_bug.cgi?id=836575
Talked to inecas, he is working on this.
This is a regression after commit 57dfe2924527f1efe66eec9bc53854bc51f27722
Fix is in pull request https://github.com/Katello/katello/pull/286
Note after more investigation:
https://bugzilla.redhat.com/show_bug.cgi?id=836575 is not caused by the fix of this bug. See comments there for details.
getting rid of 6.0.0 version since that doesn't exist
*** Bug 998028 has been marked as a duplicate of this bug. ***
This is a python specific problem which will not be an issue in the new hammer based cli.