[Bug 516785] Re: Changelog.parse_changelog doesn't actually take an iterable of lines

Bug Watch Updater 516785 at bugs.launchpad.net
Thu Aug 11 11:33:35 UTC 2011


** Changed in: python-debian (Debian)
       Status: Unknown => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-debian in Ubuntu.
https://bugs.launchpad.net/bugs/516785

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

Status in “python-debian” package in Ubuntu:
  Fix Released
Status in “python-debian” package in Debian:
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-debian/+bug/516785/+subscriptions




More information about the foundations-bugs mailing list