Catch a possible OSError from the stat call in atomic_ofstream.close().
authorZac Medico <zmedico@gentoo.org>
Sun, 19 Mar 2006 04:34:42 +0000 (04:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 19 Mar 2006 04:34:42 +0000 (04:34 -0000)
svn path=/main/trunk/; revision=2950

pym/portage_util.py

index aa84fa74e2e7f5de96cd158d31c81e3441d8ad9c..ae5312175d104b2b2a51aa03adcd2152f501560f 100644 (file)
@@ -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