[Yum-devel] Unicode Decode Error with yum info

Kulbir Saini kulbirsaini at students.iiit.ac.in
Sat Mar 15 23:53:32 UTC 2008


Hi all!

	We were not checking for possible errors while converting to utf-8. I 
have attached a patch for the same. The patch was generated using 'git 
diff'.
	This is my first patch. Hope I generated it the right way :)

Kulbir Saini wrote:
> Hi all!
>     I am a newbie trying to learn yum to participate in regular
> development. I was using yum shell and trying out random commands. The
> 'info' command seems broken in latest source. Below is the error trace.
> 
>     I did this with latest yum source which was pulled 5 minutes ago.
> 
> [project at localhost yum]$ ./yummain.py shell
> 
> Setting up Yum Shell
>> info ipw2200-firmware
> Installed Packages
> Name       : ipw2200-firmware
> Arch       : noarch
> Version    : 3.0
> Release    : 9.at
> Size       : 575 k
> Repo       : installed
> Traceback (most recent call last):
>   File "./yummain.py", line 243, in <module>
>     user_main(sys.argv[1:], exit_code=True)
>   File "./yummain.py", line 236, in user_main
>     errcode = main(args)
>   File "./yummain.py", line 111, in main
>     result, resultmsgs = base.doCommands()
>   File "/home2/Studies/project/btp/yum/cli.py", line 309, in doCommands
>     return self.yum_cli_commands[self.basecmd].doCommand(self,
> self.basecmd, self.extcmds)
>   File "/home2/Studies/project/btp/yum/yumcommands.py", line 589, in
> doCommand
>     return base.doShell()
>   File "/home2/Studies/project/btp/yum/cli.py", line 252, in doShell
>     yumshell.cmdloop()
>   File "/usr/lib/python2.5/cmd.py", line 142, in cmdloop
>     stop = self.onecmd(line)
>   File "/usr/lib/python2.5/cmd.py", line 218, in onecmd
>     return self.default(line)
>   File "/home2/Studies/project/btp/yum/shell.py", line 101, in default
>     self.base.doCommands()
>   File "/home2/Studies/project/btp/yum/cli.py", line 309, in doCommands
>     return self.yum_cli_commands[self.basecmd].doCommand(self,
> self.basecmd, self.extcmds)
>   File "/home2/Studies/project/btp/yum/yumcommands.py", line 212, in
> doCommand
>     rip = base.listPkgs(ypl.installed, _('Installed Packages'), basecmd)
>   File "/home2/Studies/project/btp/yum/output.py", line 336, in listPkgs
>     self.infoOutput(pkg)
>   File "/home2/Studies/project/btp/yum/output.py", line 303, in infoOutput
>     print self.fmtKeyValFill(_("Summary    : "), enc(pkg.summary))
>   File "/home2/Studies/project/btp/yum/output.py", line 291, in enc
>     s = unicode(s, "UTF-8")
>   File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
>     return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xae in position 22:
> unexpected code byte
> [project at localhost yum]$
> 
> 

-- 
---------------------------------------------------
Thank you,
Kulbir Saini,
Computer Science and Engineering,
International Institute of Information Technology,
Hyderbad, India - 500032.

My Home-Page: http://saini.co.in/
My Institute: http://www.iiit.ac.in/
My Linux-Blog: http://linux.saini.co.in/

IRC nick : generalBordeaux
Channels : #fedora, #fedora-devel, #yum on freenode


-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080316/239235c1/attachment.bin 


More information about the Yum-devel mailing list