Comment 1 for bug 400589

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

diff -Nru python-debian-0.1.13ubuntu1/debian/changelog python-debian-0.1.13ubuntu2/debian/changelog
--- python-debian-0.1.13ubuntu1/debian/changelog 2009-05-07 16:51:14.000000000 +0300
+++ python-debian-0.1.13ubuntu2/debian/changelog 2009-07-17 18:21:56.000000000 +0300
@@ -1,3 +1,10 @@
+python-debian (0.1.13ubuntu2) karmic; urgency=low
+
+ * fixed changelog parser exception raised when dealing with empty
+ changelog files (LP: #400589).
+
+ -- Muharem Hrnjadovic <email address hidden> Fri, 17 Jul 2009 18:04:18 +0300
+
 python-debian (0.1.13ubuntu1) karmic; urgency=low

   * Merge from debian unstable, remaining changes:
diff -Nru python-debian-0.1.13ubuntu1/debian_bundle/changelog.py python-debian-0.1.13ubuntu2/debian_bundle/changelog.py
--- python-debian-0.1.13ubuntu1/debian_bundle/changelog.py 2009-04-17 07:03:31.000000000 +0300
+++ python-debian-0.1.13ubuntu2/debian_bundle/changelog.py 2009-07-17 18:22:05.000000000 +0300
@@ -293,6 +293,10 @@
         state = first_heading
         old_state = None
         if isinstance(file, basestring):
+ # Make sure the changelog file is not empty.
+ if file is None or len(file.strip()) == 0:
+ self._parse_error('Empty changelog file.', strict)
+
             if file[-1] != '\n':
                 file += '\n'
             file = file.split('\n')[:-1]