summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGökçen Eraslan <gokcen.eraslan@gmail.com>2012-04-17 12:04:05 +0300
committerThorsten Behrens <tbehrens@suse.com>2012-04-17 13:42:46 +0200
commitcd2d737dd5b1d46261a9aa6c5caae57347a287af (patch)
tree804c8314bb187d0139e3137682fa4615e706eee7 /bin
parent212c18430864f110e5a3549c0279b1a2ea4bb6bd (diff)
Fix handling of deleted bugzilla attachments
As in https://bugs.kde.org/show_bug.cgi?ctype=xml&id=53343 <data> tag may not have a value if the attachment is deleted.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get-bugzilla-attachments-by-mimetype5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index b9488b94806f..7c779579e6a4 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -77,6 +77,11 @@ def get_from_bug_url_via_xml(url, mimetype, prefix, suffix):
print 'skipping'
break
elif node.nodeName == 'data':
+ # check if attachment is deleted (i.e. https://bugs.kde.org/show_bug.cgi?id=53343&ctype=xml)
+ if not node.firstChild:
+ print 'deleted attachment, skipping'
+ continue
+
download = suffix + '/' +prefix + id + '-' + str(attachmentid) + '.' + suffix
print 'downloading as', download
f = open(download, 'w')