Merge lp:~brian-murray/debian/sid/lptools/lp-grab-attach into lp:~debian-lptools/debian/sid/lptools/sid

Proposed by Brian Murray
Status: Needs review
Proposed branch: lp:~brian-murray/debian/sid/lptools/lp-grab-attach
Merge into: lp:~debian-lptools/debian/sid/lptools/sid
Diff against target: 41 lines (+14/-2)
2 files modified
bin/lp-grab-attachments (+6/-2)
debian/changelog (+8/-0)
To merge this branch: bzr merge lp:~brian-murray/debian/sid/lptools/lp-grab-attach
Reviewer Review Type Date Requested Status
Debian lptools maintainers Pending
Review via email: mp+398168@code.launchpad.net

Description of the change

Ubuntu has been carrying the "FailedToDecompressContent" patch for a while and OSError change is one I made locally recently.

To post a comment you must log in.

Unmerged revisions

106. By Brian Murray

bin/lp-grab-attachments: Do not crash when an attachment cannot be
downloaded because it fails to decompress. If the bug folder already
exists download attachments anyway as the bug may have new ones.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/lp-grab-attachments'
2--- bin/lp-grab-attachments 2012-10-24 14:00:22 +0000
3+++ bin/lp-grab-attachments 2021-02-16 22:30:33 +0000
4@@ -38,7 +38,7 @@
5 os.mkdir(bug_folder_name)
6 except OSError, error:
7 if error.errno == errno.EEXIST:
8- return
9+ pass
10
11 if descriptions:
12 description = bug.description
13@@ -49,7 +49,11 @@
14 local_file.close()
15
16 for attachment in bug.attachments:
17- f = attachment.data.open()
18+ try:
19+ f = attachment.data.open()
20+ except FailedToDecompressContent:
21+ print("Failed to download %s" % attachment.title)
22+ continue
23 filename = os.path.join(os.getcwd(), bug_folder_name, f.filename)
24 local_file = open(filename, "w")
25 local_file.write(f.read())
26
27=== modified file 'debian/changelog'
28--- debian/changelog 2020-08-29 20:36:32 +0000
29+++ debian/changelog 2021-02-16 22:30:33 +0000
30@@ -1,3 +1,11 @@
31+lptools (0.2.0-8) UNRELEASED; urgency=medium
32+
33+ * bin/lp-grab-attachments: Do not crash when an attachment cannot be
34+ downloaded because it fails to decompress. If the bug folder already
35+ exists download attachments anyway as the bug may have new ones.
36+
37+ -- Brian Murray <brian@ubuntu.com> Tue, 16 Feb 2021 14:23:15 -0800
38+
39 lptools (0.2.0-7) unstable; urgency=medium
40
41 [ dann frazier ]

Subscribers

People subscribed via source and target branches