From b089de98da8d363fb54a9fad88eeb1e2fb9f3218 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 29 May 2022 12:20:19 -0300 Subject: [PATCH] Switch multifile lock checks to getsize in an attempt to fix them --- biostools/extractors.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/biostools/extractors.py b/biostools/extractors.py index cf76f17..e015bc9 100644 --- a/biostools/extractors.py +++ b/biostools/extractors.py @@ -54,7 +54,9 @@ class Extractor: self.multifile_locked = True # Raise the special exception if another extractor already processed this file. - if not os.path.exists(file_path): + try: + return os.path.getsize(file_path) + except: raise MultifileStaleException() @@ -1886,10 +1888,10 @@ class InterleaveExtractor(Extractor): return False # Acquire the multi-file lock. - self.multifile_lock_acquire(file_path) + file_size = self.multifile_lock_acquire(file_path) # Create temporary interleaved data array. - part_size = min(os.path.getsize(file_path), 16777216) + part_size = min(file_size, 16777216) data = [] # Look for each counterpart.