[python-debian/master] Patch from Muharem to handle empty changelog strings

James Westby jw+debian at jameswestby.net
Fri Jul 17 16:12:16 UTC 2009


---
 debian/changelog           |    4 ++++
 debian_bundle/changelog.py |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 34d200c..3e83c3f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,10 @@ python-debian (0.1.14) UNRELEASED; urgency=low
   [ Filippo Giunchedi ]
   * deb822: parse also Binary as PkgRelation, thus add .binary attribute
 
+  [ Muharem Hrnjadovic ]
+  * fixed changelog parser exception raised when dealing with empty
+    changelog files (LP: #400589).
+
  -- Filippo Giunchedi <filippo at debian.org>  Sun, 07 Jun 2009 22:00:21 +0200
 
 python-debian (0.1.13) unstable; urgency=low
diff --git a/debian_bundle/changelog.py b/debian_bundle/changelog.py
index e4cf450..07fe4fa 100644
--- a/debian_bundle/changelog.py
+++ b/debian_bundle/changelog.py
@@ -293,6 +293,11 @@ class Changelog(object):
         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)
+                return
+
             if file[-1] != '\n':
                 file += '\n'
             file = file.split('\n')[:-1]
-- 
1.5.6.5




More information about the pkg-python-debian-commits mailing list