From: Zac Medico Date: Tue, 2 Mar 2010 19:50:41 +0000 (-0000) Subject: In __iter__, handle OSError from lstat in case a cache entry disappears. X-Git-Tag: v2.1.8~186 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=40e9787a2ebff1089a5b0da11bab92695e44eb3e;p=portage.git In __iter__, handle OSError from lstat in case a cache entry disappears. (trunk r15297) svn path=/main/branches/2.1.7/; revision=15536 --- diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py index a010e5061..b014f170d 100644 --- a/pym/portage/cache/flat_hash.py +++ b/pym/portage/cache/flat_hash.py @@ -135,7 +135,11 @@ class database(fs_template.FsBased): if l.endswith(".cpickle"): continue p = os.path.join(dir_path, l) - st = os.lstat(p) + try: + st = os.lstat(p) + except OSError: + # Cache entry disappeared. + continue if stat.S_ISDIR(st.st_mode): # Only recurse 1 deep, in order to avoid iteration over # entries from another nested cache instance. This can