From 75b611a4d27fe2df94e0c5dd38df42bf01f2bf07 Mon Sep 17 00:00:00 2001 From: Luke Macken Date: Thu, 6 Dec 2007 22:44:24 -0500 Subject: [PATCH] Better unicode handling in modifyrepo --- modifyrepo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modifyrepo.py b/modifyrepo.py index 29a7a63..bf1987f 100755 --- a/modifyrepo.py +++ b/modifyrepo.py @@ -74,7 +74,7 @@ class RepoMetadata: mdtype = mdname.split('.')[0] destmd = os.path.join(self.repodir, mdname) newmd = gzip.GzipFile(destmd, 'wb') - newmd.write(md) + newmd.write(md.encode('utf-8')) newmd.close() print "Wrote:", destmd @@ -104,7 +104,7 @@ class RepoMetadata: print " location =", 'repodata/' + mdname print " checksum =", sha.new(newmd).hexdigest() print " timestamp =", str(os.stat(destmd).st_mtime) - print " open-checksum =", sha.new(md).hexdigest() + print " open-checksum =", sha.new(md.encode('utf-8')).hexdigest() ## Write the updated repomd.xml outmd = file(self.repomdxml, 'w') -- 2.34.1