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
=== modified file 'bin/lp-grab-attachments'
--- bin/lp-grab-attachments 2012-10-24 14:00:22 +0000
+++ bin/lp-grab-attachments 2021-02-16 22:30:33 +0000
@@ -38,7 +38,7 @@
38 os.mkdir(bug_folder_name)38 os.mkdir(bug_folder_name)
39 except OSError, error:39 except OSError, error:
40 if error.errno == errno.EEXIST:40 if error.errno == errno.EEXIST:
41 return41 pass
4242
43 if descriptions:43 if descriptions:
44 description = bug.description44 description = bug.description
@@ -49,7 +49,11 @@
49 local_file.close()49 local_file.close()
5050
51 for attachment in bug.attachments:51 for attachment in bug.attachments:
52 f = attachment.data.open()52 try:
53 f = attachment.data.open()
54 except FailedToDecompressContent:
55 print("Failed to download %s" % attachment.title)
56 continue
53 filename = os.path.join(os.getcwd(), bug_folder_name, f.filename)57 filename = os.path.join(os.getcwd(), bug_folder_name, f.filename)
54 local_file = open(filename, "w")58 local_file = open(filename, "w")
55 local_file.write(f.read())59 local_file.write(f.read())
5660
=== modified file 'debian/changelog'
--- debian/changelog 2020-08-29 20:36:32 +0000
+++ debian/changelog 2021-02-16 22:30:33 +0000
@@ -1,3 +1,11 @@
1lptools (0.2.0-8) UNRELEASED; urgency=medium
2
3 * bin/lp-grab-attachments: Do not crash when an attachment cannot be
4 downloaded because it fails to decompress. If the bug folder already
5 exists download attachments anyway as the bug may have new ones.
6
7 -- Brian Murray <brian@ubuntu.com> Tue, 16 Feb 2021 14:23:15 -0800
8
1lptools (0.2.0-7) unstable; urgency=medium9lptools (0.2.0-7) unstable; urgency=medium
210
3 [ dann frazier ]11 [ dann frazier ]

Subscribers

People subscribed via source and target branches