fix for error when string is None for utf8 conversion
authorSeth Vidal <skvidal@linux.duke.edu>
Sat, 11 Sep 2004 20:07:08 +0000 (20:07 +0000)
committerSeth Vidal <skvidal@linux.duke.edu>
Sat, 11 Sep 2004 20:07:08 +0000 (20:07 +0000)
dumpMetadata.py
genpkgmetadata.py

index 020a770abfd5c7033d08a29bd6e5f5f98f15b5a5..f4ea4327e900d74482d2da2f745a2eae0764384a 100644 (file)
@@ -86,7 +86,9 @@ def getChecksum(sumtype, file, CHUNK=2**16):
 
 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')
@@ -674,7 +676,7 @@ def repoXML(node, cmds):
         location = data.newChild(None, 'location', None)
         if cmds['baseurl'] is not None:
             location.newProp('xml:base', cmds['baseurl'])
-        location.newProp('href', os.path.join(cmds['finaldir'], grpfile))
+        location.newProp('href', os.path.join(cmds['finaldir'], sfile))
         checksum = data.newChild(None, 'checksum', csum)
         checksum.newProp('type', sumtype)
         timestamp = data.newChild(None, 'timestamp', str(timestamp))
index 050bf24c77180bfc1a3891e0745b03dd9359783e..02dd452967ce0d1f6a3020bb38dd6433e070ea11 100755 (executable)
@@ -33,7 +33,7 @@ from zlib import error as zlibError
 from gzip import write32u, FNAME
 
 import dumpMetadata
-__version__ = '0.3.7'
+__version__ = '0.3.8'
 
 def errorprint(stuff):
     print >> sys.stderr, stuff