[Yum-devel] [PATCH] ensure all attribute values are utf-8-encoded strs and properly xml-attribute-escaped

James Antill james at fedoraproject.org
Thu Aug 6 19:17:24 UTC 2009


On Tue, 2009-08-04 at 18:22 -0400, Mike Bonnet wrote:
> When reading package metadata out of a database, sqlite returns unicode objects.

 This seems fine, to me, from a correctness POV. However:

> diff --git a/yum/packages.py b/yum/packages.py
> index a7e81e6..af33d94 100644
> --- a/yum/packages.py
> +++ b/yum/packages.py
> @@ -863,13 +863,13 @@ class YumAvailablePackage(PackageObject, RpmBase):
>           for (name, flags, (e,v,r)) in mylist:
>               pcostring = '''      <rpm:entry name="%s"''' % misc.to_xml(name, attrib=True)
>               if flags:
> -                pcostring += ''' flags="%s"''' % flags
> +                pcostring += ''' flags="%s"''' % misc.to_xml(flags, attrib=True)

 Is it really necessary to use to_xml() instead of just to_utf8()? The
obvious difference would be does that affect performance? I'm guessing
it's probably fine, but any significant difference is going to add up on
a rawhide compose.

-- 
James Antill <james at fedoraproject.org>
Fedora


More information about the Yum-devel mailing list