Bug 447605 - UnicodeWarning prevents user interaction with yum in some locales
UnicodeWarning prevents user interaction with yum in some locales
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-20 15:19 EDT by Miloš Komarčević
Modified: 2014-01-21 18:03 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-30 12:23:35 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)

  None (edit)
Description Miloš Komarčević 2008-05-20 15:19:40 EDT
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.

Output:

Укупна величина преузимања: 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 17:12:38 EDT
 Is this fixed if you do:

choice = unicode(choice)

...just before the above lines?
Comment 2 Miloš Komarčević 2008-05-21 15:18:10 EDT
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
    base.doTransaction()
  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 15:56:42 EDT
 This was before the line:

            choice = choice.lower()

...?
Comment 4 Miloš Komarčević 2008-05-21 16:13:20 EDT
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 00:23:54 EDT
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
English).
Comment 6 James Antill 2008-05-27 11:27:59 EDT
 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.