Re: [Fwd: Re: yum 2.1.0]
Ville Skyttä <[email protected]>
| Newsgroups | gmane.linux.rpm.metadata |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2004-09-03 at 21:07, seth vidal wrote: > Take a look at this traceback. This happens after applying your patch. > I'm going to work on it but if I remember correctly this is the reason > why I didn't try to do too much tricky stuff with encoding conversion in > createrepo. Hm, I don't think it's really that much about encoding conversion, but just that utf8string() does not check for None, and rpmObj.tagByName() in dumpMetaData.generateXML() behaves differently with nonexistent tags on FC1 than it does on FC2: returns None on FC1, empty string on FC2. The attached patch is a quick fix for utf8string(); perhaps it would be a good idea to additionally make tagByName() never return None but an empty string instead so that it won't bite elsewhere later? _______________________________________________ Rpm-metadata mailing list [email protected] https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
utf8string-none.patch
(text/x-patch, 587 B)
Index: dumpMetadata.py
===================================================================
RCS file: /cvsroot/metadata/cvs-root/generate/dumpMetadata.py,v
retrieving revision 1.22
diff -a -u -r1.22 dumpMetadata.py
--- dumpMetadata.py 27 Aug 2004 07:03:40 -0000 1.22
+++ dumpMetadata.py 3 Sep 2004 19:27:10 -0000
@@ -86,7 +86,9 @@
def utf8String(string):
"""hands back a unicoded string"""
- if isinstance(string, unicode):
+ if string is None:
+ return ''
+ elif isinstance(string, unicode):
return string
try:
x = unicode(string, 'ascii')