Merge pull request #140 from vbanos/fix-writer-problem

Handle ValueError when trying to close WARC file
This commit is contained in:
Noah Levitt 2019-09-23 10:08:36 -07:00 committed by GitHub
commit af0fe2892c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ class WarcWriter:
if self.open_suffix == '':
try:
fcntl.lockf(self.f, fcntl.LOCK_UN)
except IOError as exc:
except Exception as exc:
self.logger.error(
'could not unlock file %s (%s)', self.path, exc)
self.f.close()