From: Zac Medico Date: Wed, 31 Jan 2007 22:46:33 +0000 (-0000) Subject: Don't use os.path.isdir() because it can swallow errors related to filesystem/disk... X-Git-Tag: v2.2_pre1~1777 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0a5cb473f87362eec417f6fe1a9297e690a8cbf9;p=portage.git Don't use os.path.isdir() because it can swallow errors related to filesystem/disk corruption. svn path=/main/trunk/; revision=5852 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index f58af8411..25c676f8e 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5309,8 +5309,14 @@ class vardbapi(dbapi): def _aux_get(self, mycpv, wants): mydir = os.path.join(self.root, VDB_PATH, mycpv) - if not os.path.isdir(mydir): - raise KeyError(mycpv) + try: + if not stat.S_ISDIR(os.stat(mydir).st_mode): + raise KeyError(mycpv) + except OSError, e: + if e.errno == errno.ENOENT: + raise KeyError(mycpv) + del e + raise results = [] for x in wants: try: