From 29ce667433fcaf3227252ef686ee9d0e43103808 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 10 Sep 2009 06:26:13 +0000 Subject: [PATCH] fix for permission error for not owning dir... eitherway process returns to cwd when finished BUG:FIXED:6748 --- pisi/archive.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pisi/archive.py b/pisi/archive.py index 411329ae..31d013f6 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -13,6 +13,7 @@ """Archive module provides access to regular archive file types.""" # standard library modules +import exceptions import os import stat import shutil @@ -178,7 +179,11 @@ class ArchiveTar(ArchiveBase): if self.type == 'tarlzma' or self.type == 'tarZ': os.unlink(self.file_path) - os.chdir(oldwd) + try: + os.chdir(oldwd) + # Bug #6748 + except exceptions.OSError: + pass self.close() def add_to_archive(self, file_name, arc_name=None):