Failure to deal with empty changelog files
Bug #400589 reported by
Muharem Hrnjadovic
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-debian (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: python-debian
When the changelog file is empty the following exception occurs:
{{{
File "/var/lib/
if file[-1] != '\n':
IndexError: string index out of range
}}}
Please note: this is related to bug #360670.
Changed in python-debian (Ubuntu): | |
status: | New → Confirmed |
To post a comment you must log in.
diff -Nru python- debian- 0.1.13ubuntu1/ debian/ changelog python- debian- 0.1.13ubuntu2/ debian/ changelog debian- 0.1.13ubuntu1/ debian/ changelog 2009-05-07 16:51:14.000000000 +0300 debian- 0.1.13ubuntu2/ debian/ changelog 2009-07-17 18:21:56.000000000 +0300
--- python-
+++ python-
@@ -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: debian- 0.1.13ubuntu1/ debian_ bundle/ changelog. py python- debian- 0.1.13ubuntu2/ debian_ bundle/ changelog. py debian- 0.1.13ubuntu1/ debian_ bundle/ changelog. py 2009-04-17 07:03:31.000000000 +0300 debian- 0.1.13ubuntu2/ debian_ bundle/ changelog. py 2009-07-17 18:22:05.000000000 +0300 error(' Empty changelog file.', strict)
file += '\n' '\n')[: -1]
diff -Nru python-
--- python-
+++ python-
@@ -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_
+
if file[-1] != '\n':
file = file.split(