mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
Merge pull request #142 from vbanos/fix-close-rename
Another exception when trying to close a WARC file
This commit is contained in:
commit
22d786f72e
@ -170,11 +170,14 @@ class WarcWriter:
|
||||
except Exception as exc:
|
||||
self.logger.error(
|
||||
'could not unlock file %s (%s)', self.path, exc)
|
||||
self.f.close()
|
||||
finalpath = os.path.sep.join(
|
||||
[self.directory, self.finalname])
|
||||
os.rename(self.path, finalpath)
|
||||
|
||||
try:
|
||||
self.f.close()
|
||||
finalpath = os.path.sep.join(
|
||||
[self.directory, self.finalname])
|
||||
os.rename(self.path, finalpath)
|
||||
except Exception as exc:
|
||||
self.logger.error(
|
||||
'could not close and rename file %s (%s)', self.path, exc)
|
||||
self.path = None
|
||||
self.f = None
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user