borg/borg
Thomas Waldmann 5a39d5c4f8 make LoggedIO.close_segment reentrant
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.
2017-01-28 22:38:25 +01:00
..
testsuite Merge pull request #2015 from ThomasWaldmann/fix-location-regex 2017-01-21 05:46:58 +01:00
__init__.py implement borgmajor/minor/patch placeholders, fixes #1694 2016-10-22 00:20:50 +02:00
__main__.py
_chunker.c
_hashindex.c hashindex: separate endian-dependent defs from endian detection 2017-01-21 17:25:38 +01:00
archive.py create: don't create hard link refs to failed files 2017-01-22 02:21:26 +01:00
archiver.py mount: umount on SIGINT/^C when in foreground 2017-01-28 14:54:56 +01:00
cache.py fix determination of newest mtime, fixes #1860 2016-11-20 00:08:33 +01:00
chunker.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
compress.pyx lz4: reuse helpers.Buffer 2016-08-13 01:46:15 +02:00
crypto.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
fuse.py Merge pull request #2102 from enkore/issue/2082 2017-01-28 15:14:22 +01:00
hashindex.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
helpers.py Merge pull request #2015 from ThomasWaldmann/fix-location-regex 2017-01-21 05:46:58 +01:00
key.py init: explain manifest auth compatibility 2016-12-19 04:01:27 +01:00
keymanager.py backport bin_to_hex and use it 2016-10-06 05:15:01 +02:00
locking.py repository: fix spurious, empty lock.roster on InvalidRepository exception 2016-08-18 00:54:12 +02:00
logger.py
lrucache.py
platform.py API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
platform_darwin.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
platform_freebsd.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
platform_linux.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
remote.py borg serve: fix transmission data loss of pipe writes, fixes #1268 2017-01-13 20:40:40 +01:00
repository.py make LoggedIO.close_segment reentrant 2017-01-28 22:38:25 +01:00
shellpattern.py
upgrader.py always setup module level "logger" in the same way 2017-01-06 05:48:50 +01:00
xattr.py helpers.Buffer: raise OSError subclass if too much memory is allocd 2017-01-04 19:28:05 +01:00