Bug 441455 - yum traceback with UnicodeEncodeError
yum traceback with UnicodeEncodeError
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-08 03:50 EDT by Karsten Hopp
Modified: 2014-01-21 18:02 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-17 08:25:51 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)
example yum output (2.55 KB, text/plain)
2008-04-09 06:20 EDT, Sebastian Vahl
no flags Details
yum output with strace (4.29 MB, text/plain)
2008-04-11 18:21 EDT, Sebastian Vahl
no flags Details

  None (edit)
Description Karsten Hopp 2008-04-08 03:50:35 EDT
Description of problem:
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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 192, in main
    return exFatal(e)
  File "/usr/share/yum-cli/yummain.py", line 63, in exFatal
    logger.critical('\n\n%s', str(e))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 14:
ordinal not in range(128)

Version-Release number of selected component (if applicable):
yum-3.2.13-2.fc9.noarch

How reproducible:
always

Steps to Reproduce:
1. LANG=de_DE.UTF-8
2. yum update
3.
Comment 1 Karsten Hopp 2008-04-08 05:42:11 EDT
reproducable with yum-3.2.14-2.fc9.noarch
Comment 2 Sebastian Vahl 2008-04-09 06:20:07 EDT
Created attachment 301773 [details]
example yum output

Same problem here with yum-3.2.14-2.fc9.noarch.

"LANG=en_US.UTF-8 yum <command>" works normal.

# cat /etc/sysconfig/i18n
LANG="de_DE.UTF-8"
SYSFONT="latarcyrheb-sun16"
Comment 3 James Antill 2008-04-09 09:58:39 EDT
 Sebastian, you get a backtrace that looks like the above?
 And it goes away completely if you change to use LANG=en_US.UTF-8?
Comment 5 Sebastian Vahl 2008-04-09 15:58:28 EDT
(In reply to comment #3)
>  Sebastian, you get a backtrace that looks like the above?

Yes.

>  And it goes away completely if you change to use LANG=en_US.UTF-8?

I've seen this error for the first time today. "yum update" was working normal.
And yes, with LANG=en_US.UTF-8 all is working normal.

(In reply to comment #4)
>  Can you try:
> 
>
http://koji.fedoraproject.org/packages/yum/3.2.14/3.fc9/noarch/yum-3.2.14-3.fc9.noarch.rpm

No luck:

Führe Verarbeitung durch
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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 764, in
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 4:
ordinal not in range(128)
Comment 6 Seth Vidal 2008-04-10 11:44:55 EDT
You were redirecting to a file, weren't you?
Comment 8 Sebastian Vahl 2008-04-10 15:43:43 EDT
(In reply to comment #6)
> You were redirecting to a file, weren't you?

No. I've tried to redirect the output with tee to a file once, but then the 
error didn't happen.

(In reply to comment #7)
> Can you test this version:
> 
http://koji.fedoraproject.org/packages/yum/3.2.14/4.fc9/noarch/yum-3.2.14-4.fc9.noarch.rpm
> 

Still failing:
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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 
4: ordinal not in range(128)


Is there a way how I can provide more informations? yum -d 9 ?



Comment 9 Seth Vidal 2008-04-10 15:56:27 EDT
can you edit line 750 of:
/usr/share/yum-cli/output.py

change it to read:
sys.stdout.write(to_unicode(msg))

and then re-run the case which makes the message.

I'm curious what is being outputted.

Comment 10 Sebastian Vahl 2008-04-10 16:08:00 EDT
Still no luck:

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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(to_unicode(msg))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 
4: ordinal not in range(128)
Comment 11 Seth Vidal 2008-04-10 16:15:51 EDT
in the above traceback were you outputting to a file or to a stdout?
Comment 12 Sebastian Vahl 2008-04-10 16:26:53 EDT
(In reply to comment #11)
> in the above traceback were you outputting to a file or to a stdout?
> 

stout (through a ssh connection if that matters)
Comment 14 Sebastian Vahl 2008-04-11 03:32:31 EDT
(In reply to comment #13)
>  Ok, another try:
> 
> 
http://koji.fedoraproject.org/packages/yum/3.2.14/5.fc9/noarch/yum-3.2.14-5.fc9.noarch.rpm

Output in stdout:

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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 
4: ordinal not in range(128)

---

I've then also tried all other translations and all are working fine (but I 
don't know which ones are really using unicode chars):
LANG=fr_FR.UTF-8 yum -y reinstall gdm
LANG=da_DK.UTF-8 yum -y reinstall gdm
LANG=it_IT.UTF-8 yum -y reinstall gdm
LANG=ms_MY.UTF-8 yum -y reinstall gdm  
LANG=nb_NO.UTF-8 yum -y reinstall gdm
LANG=pl_PL.UTF-8 yum -y reinstall gdm
LANG=pt_PT.UTF-8 yum -y reinstall gdm
LANG=pt_BR.UTF-8 yum -y reinstall gdm
LANG=ru_RU.UTF-8 yum -y reinstall gdm

Only this one is also failing:
LANG=sr_RS.UTF-8 yum -y reinstall gdm

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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-9: 
ordinal not in range(128)

---

So is maybe the german translation just broken?
Comment 15 Adrian "Adi1981" P. 2008-04-11 18:00:39 EDT
Do you have some other repos than default fedora's ? Have you got all gpg key's
imported if you've got some other repo? Got similar problem with pl_PL.UTF-8 (
bug #438580 ), but in my case problem exist when there's missing gpg key (for
livna repo) - importing key fixes the problem. You can do "strace yum update"
and see if you'll have some warnings before backtrace. For me it was:

gettimeofday({1207867139, 691711}, NULL) = 0
stat64("/etc/pki/rpm-gpg/RPM-GPG-KEY-livna", 0xbfd87c28) = -1 ENOENT (No such
file or directory)
write(2, "Traceback (most recent call last"..., 35Traceback (most recent call
last):

Maybe it's still the same problem?
Comment 16 Adrian "Adi1981" P. 2008-04-11 18:04:06 EDT
uhhh.. now i realized that gdm is in fedora's repo, so probably it wont be the
same problem...
Comment 17 Sebastian Vahl 2008-04-11 18:21:47 EDT
Created attachment 302175 [details]
yum output with strace

(In reply to comment #16)
> uhhh.. now i realized that gdm is in fedora's repo, so probably it wont be
the
> same problem...

However, I've removed all additional repos from /etc/yum.repos.d an hit this
command if this would help in a way:

strace yum -d 9 --noplugins -y reinstall gdm 2>&1 | tee yum-strace.log
Comment 18 James Antill 2008-04-11 19:37:20 EDT
 Ok, we're pretty sure this one will fix it and if not there's a config. option
to turn the i18n stuff off now:

http://koji.fedoraproject.org/packages/yum/3.2.14/6.fc9/noarch/yum-3.2.14-6.fc9.noarch.rpm
Comment 19 Sebastian Vahl 2008-04-12 03:07:02 EDT
(In reply to comment #18)
>  Ok, we're pretty sure this one will fix it and if not there's a config. 
option
> to turn the i18n stuff off now:
> 
> 
http://koji.fedoraproject.org/packages/yum/3.2.14/6.fc9/noarch/yum-3.2.14-6.fc9.noarch.rpm

Sorry, still not working:

yum -y --noplugins reinstall gdm
Einrichten des Neuinstallationsprozess
Schliesse Pakete aus von Livna for Fedora Core 8.92 - i386 - Development Tree
Finished
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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 111, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 309, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, 
self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 781, in doCommand
    return 1, [str(e)]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 
35: ordinal not in range(128)


But it even makes things worse:
# yum --help
Geladene Plugins: changelog, downloadonly, fastestmirror, fedorakmod,
                : protectbase, refresh-packagekit, security
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 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 91, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 194, in getOptionsConfig
    (opts, self.cmds) = self.optparser.setupYumConfig()
  File "/usr/share/yum-cli/cli.py", line 999, in setupYumConfig
    (opts, cmds) = self.parse_args()
  File "/usr/lib/python2.5/optparse.py", line 1378, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1418, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1493, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.5/optparse.py", line 782, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.5/optparse.py", line 804, in take_action
    parser.print_help()
  File "/usr/lib/python2.5/optparse.py", line 1648, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
  File "/usr/lib/python2.5/codecs.py", line 303, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 150: 
ordinal not in range(128)

(tested with LANG=de_DE.UTF-8)


Comment 20 Sebastian Vahl 2008-04-14 07:12:37 EDT
Not sure what has happened, but today a "yum -y reinstall gdm" with 
yum-3.2.14-6.fc9.noarch isn't failing anymore. But "yum --help" with this 
version still does.
With the current version in rawhide, yum-3.2.14-2.fc9.noarch, the help is 
working, but the reinstall is also failing.

(In reply to comment #18)
>  Ok, we're pretty sure this one will fix it and if not there's a config. 
option
> to turn the i18n stuff off now:

How do I use this option?

Comment 21 Sebastian Vahl 2008-04-17 05:41:06 EDT
Seems to be working with yum-3.2.14-9.fc9.noarch in my local language 
(de_DE.UTF-8) and with LANG=sr_RS.UTF-8 for my problematic actions ("yum -y 
reinstall gdm" and "yum --help").

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