From 47f680305ec673d4829f1eb97e51d8102b3ed747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Thu, 13 Apr 2006 17:34:25 +0000 Subject: [PATCH] fixy --- pisi/file.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pisi/file.py b/pisi/file.py index facabb08..78aaa4e8 100644 --- a/pisi/file.py +++ b/pisi/file.py @@ -161,11 +161,12 @@ class File: self.__file__.close() if self.mode == File.write: if self.compress == File.bz2: - bc = bz2.BZ2Compressor() - bc.compress(open(self.localfile).read()) + bz2file = self.localfile + ".bz2" + bz2.BZ2File(bz2file, "w").write(open(self.localfile, "r").read()) - self.localfile = self.localfile + ".bz2" - open(self.localfile, "w").write(bc.flush()) + # FIXME: I hate side effects, but this is designed + # that way :(. -- baris + self.localfile = bz2file elif self.compress == File.sevenzip: raise Error(_("sevenzip compression not supported yet"))