Changelog.parse_changelog doesn't actually take an iterable of lines

Bug #516785 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-debian (Debian)
Fix Released
Unknown
python-debian (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: python-debian

The interface for Changelog.__init__ and Changelog.parse_changelog look like you could pass in a 'file' object or any iterable of lines. (like a list of lines).

However if you look closer, in the

if isinstance(file, basestring):
section it does

file = file.split('\n')

Which removes all '\n' characters, and the following for loop assumes that is true (so it adds them back in).

It should probably instead do something like:

file = file.splitlines(True)

and then leave the individual lines alone.

This would allow you to pass in a real file() object, or anything that can be iterated to get lines out.

Jelmer Vernooij (jelmer)
Changed in python-debian (Ubuntu):
status: New → Fix Released
Changed in python-debian (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.