From c9e632d62383d028f5277456fec0c5079ed8ffb8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 1 Feb 2007 20:22:16 +0000 Subject: Don't use os.path.isdir() because it can swallow errors related to filesystem/disk corruption. (trunk r5851:5852) svn path=/main/branches/2.1.2/; revision=5869 --- pym/portage.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pym') diff --git a/pym/portage.py b/pym/portage.py index b7ba73f37..25c4d7a14 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5271,8 +5271,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: -- cgit v1.2.3-1-g7c22