From 0a5cb473f87362eec417f6fe1a9297e690a8cbf9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 31 Jan 2007 22:46:33 +0000 Subject: [PATCH] Don't use os.path.isdir() because it can swallow errors related to filesystem/disk corruption. svn path=/main/trunk/; revision=5852 --- pym/portage/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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: -- 2.26.2