Bug 447605 - UnicodeWarning prevents user interaction with yum in some locales
Summary: UnicodeWarning prevents user interaction with yum in some locales
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-05-20 19:19 UTC by Miloš Komarčević
Modified: 2014-01-21 23:03 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-05-30 16:23:35 UTC

Attachments (Terms of Use)

Description Miloš Komarčević 2008-05-20 19:19:40 UTC
It is impossible to interact with yum when in sr_RS.utf8 locale, where 'y', 'n',
'yes' and 'no' have been translated to local Cyrillic counterparts 'д', 'н',
'да', and 'не', all using UTF-8. This probably also affects other locales using
non-ASCII characters.


Укупна величина преузимања: 110 k
Да ли је ово у реду [д/Н]: д
/usr/share/yum-cli/output.py:360: UnicodeWarning: Unicode equal comparison
failed to convert both arguments to Unicode - interpreting them as being unequal
  if len(choice) == 0 or choice in [_('y'), _('n'), _('yes'), _('no')]:
Да ли је ово у реду [д/Н]:

Comment 1 James Antill 2008-05-20 21:12:38 UTC
 Is this fixed if you do:

choice = unicode(choice)

...just before the above lines?

Comment 2 Miloš Komarčević 2008-05-21 19:18:10 UTC
Nope, got the following traceback:

Да ли је ово у реду [д/Н]: д
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 241, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 193, in main
  File "/usr/share/yum-cli/cli.py", line 348, in doTransaction
    if not self.userconfirm():
  File "/usr/share/yum-cli/output.py", line 360, in userconfirm
    choice = unicode(choice)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal
not in range(128)

Comment 3 James Antill 2008-05-21 19:56:42 UTC
 This was before the line:

            choice = choice.lower()


Comment 4 Miloš Komarčević 2008-05-21 20:13:20 UTC
The above report was for after, but the same error is reported when inserted
before as well (just on line 359 instead of course).

Comment 5 Igor Miletic 2008-05-27 04:23:54 UTC
If I place the line:

            choice = unicode(choice, 'utf-8', 'replace')

after the line:

            choice = choice.lower()

yum works well for bith sr_RS.UTF-8 language (Serbian) and en_US.UTF-8 (American

Comment 6 James Antill 2008-05-27 15:27:59 UTC
 The above doesn't make much sense ... but I've checked in a fix which I think
will help you, and it seems to work for me when I use LANG=sr_RS.utf8.

 It's upstream commit: d9a2fac4f73a867a70ff460f2416d38a577cc4e4
 This should be fixed by 3.2.17, whenever that is released.

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