From 774974c13db1904765f149e85e6fd9910770b088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Mon, 12 Jul 2010 13:18:04 +0000 Subject: [PATCH] archive: Fix TypeError when adding an empty dir to ZIP archives Fixes archivetest. --- pisi/archive.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pisi/archive.py b/pisi/archive.py index 83eaabc8..6536385f 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -448,6 +448,7 @@ class ArchiveZip(ArchiveBase): # It's a pity that zipfile can't handle unicode strings. Grrr! file_name = str(file_name) if os.path.isdir(file_name) and not os.path.islink(file_name): + arc_name = arc_name or "" self.zip_obj.writestr(arc_name + '/', '') attr_obj = self.zip_obj.getinfo(arc_name + '/') attr_obj.external_attr = stat.S_IMODE(os.stat(file_name)[0]) << 16L