mirror of https://github.com/borgbackup/borg.git
5a39d5c4f8
if anything blows up in the middle of a (first) invocation of close_segment() and an exception gets raised, it could happen that close_segment() gets called again (e.g. in Repository.__del__ or elsewhere). As the self._write_fd was set to None rather late, it would re-enter the if-block then. The new code gets the value of self._write_fd and also sets it to None in one tuple assignment, so re-entrance does not happen. Also, it uses try/finally to make sure the important parts (fd.close()) gets executed, even if there are exceptions in the other parts. |
||
---|---|---|
.. | ||
testsuite | ||
__init__.py | ||
__main__.py | ||
_chunker.c | ||
_hashindex.c | ||
archive.py | ||
archiver.py | ||
cache.py | ||
chunker.pyx | ||
compress.pyx | ||
crypto.pyx | ||
fuse.py | ||
hashindex.pyx | ||
helpers.py | ||
key.py | ||
keymanager.py | ||
locking.py | ||
logger.py | ||
lrucache.py | ||
platform.py | ||
platform_darwin.pyx | ||
platform_freebsd.pyx | ||
platform_linux.pyx | ||
remote.py | ||
repository.py | ||
shellpattern.py | ||
upgrader.py | ||
xattr.py |