[Libreoffice-commits] .: bin/get-bugzilla-attachments-by-mimetype

Thorsten Behrens thorsten at kemper.freedesktop.org
Tue Apr 17 04:44:15 PDT 2012


 bin/get-bugzilla-attachments-by-mimetype |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit cd2d737dd5b1d46261a9aa6c5caae57347a287af
Author: Gökçen Eraslan <gokcen.eraslan at gmail.com>
Date:   Tue Apr 17 12:04:05 2012 +0300

    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.

diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index b9488b9..7c77957 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')


More information about the Libreoffice-commits mailing list