From: Zac Medico Date: Sun, 19 Mar 2006 04:34:42 +0000 (-0000) Subject: Catch a possible OSError from the stat call in atomic_ofstream.close(). X-Git-Tag: v2.1_pre7~31 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=b8f12667b49a5994e0258b8ab88361aceb54bb3b;p=portage.git Catch a possible OSError from the stat call in atomic_ofstream.close(). svn path=/main/trunk/; revision=2950 --- diff --git a/pym/portage_util.py b/pym/portage_util.py index aa84fa74e..ae5312175 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -628,6 +628,11 @@ class atomic_ofstream(file): pass except FileNotFound: pass + except OSError, oe: # from the above os.stat call + if oe.errno in (errno.ENOENT, errno.EPERM): + pass + else: + raise os.rename(self.name, self._real_name) finally: # Make sure we cleanup the temp file