Merge lp:~m4ktub/duplicity/0.6-reliability into lp:duplicity/0.6-series

Proposed by Claudio Gil on 2014-11-22
Status: Merged
Merged at revision: 998
Proposed branch: lp:~m4ktub/duplicity/0.6-reliability
Merge into: lp:duplicity/0.6-series
Diff against target: 52 lines (+23/-18)
1 file modified
duplicity/gpg.py (+23/-18)
To merge this branch: bzr merge lp:~m4ktub/duplicity/0.6-reliability
Reviewer Review Type Date Requested Status
duplicity-team 2014-11-22 Pending
Review via email: mp+242575@code.launchpad.net

Description of the change

This branch contains the fix proposed in Bug #1395341.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/gpg.py'
2--- duplicity/gpg.py 2014-05-07 12:51:00 +0000
3+++ duplicity/gpg.py 2014-11-22 21:38:02 +0000
4@@ -323,25 +323,30 @@
5 data_size = target_size - max_footer_size
6 file = GPGFile(True, path.Path(filename), profile)
7 at_end_of_blockiter = 0
8- while True:
9- bytes_to_go = data_size - get_current_size()
10- if bytes_to_go < block_iter.get_read_size():
11- break
12- try:
13- data = block_iter.next().data
14- except StopIteration:
15- at_end_of_blockiter = 1
16- break
17- file.write(data)
18+ try:
19+ while True:
20+ bytes_to_go = data_size - get_current_size()
21+ if bytes_to_go < block_iter.get_read_size():
22+ break
23+ try:
24+ data = block_iter.next().data
25+ except StopIteration:
26+ at_end_of_blockiter = 1
27+ break
28+ file.write(data)
29
30- file.write(block_iter.get_footer())
31- if not at_end_of_blockiter:
32- # don't pad last volume
33- cursize = get_current_size()
34- if cursize < target_size:
35- top_off(target_size - cursize, file)
36- file.close()
37- return at_end_of_blockiter
38+ file.write(block_iter.get_footer())
39+ if not at_end_of_blockiter:
40+ # don't pad last volume
41+ cursize = get_current_size()
42+ if cursize < target_size:
43+ top_off(target_size - cursize, file)
44+ file.close()
45+ return at_end_of_blockiter
46+ except Exception:
47+ # ensure that GPG processing terminates
48+ file.close()
49+ raise
50
51
52 def GzipWriteFile(block_iter, filename,

Subscribers

People subscribed via source and target branches

to all changes: