Bug#597120: python-debian: Changes: Should raise exception when serializing invalid data

John Wright jsw at debian.org
Sat Sep 18 04:15:42 UTC 2010


On Thu, Sep 16, 2010 at 09:14:28PM +0200, Jelmer Vernooij wrote:
> Package: python-debian
> Version: 0.1.17~bzr184~launchpad1
> Severity: normal
> 
> 
> The Changes() object (but probably other deb822-style objects as well)
> don't handle the situation very well when a field that contains empty
> lines is followed by another field:
> 
> #!/usr/bin/python
> from debian.deb822 import Changes
> x = Changes()
> x["Changes"] = """Foo
> 
> Bar
> """
> x["Format"] = "1.8"
> y = Changes(x.dump())
> print y["Format"]
> 
> It would be nice if an exception was raised instead of an invalid changes file
> being written.

I actually had a patch out for review about a year ago that would have
fixed this problem at __setitem__ time (it wouldn't have let you set
x["Changes"] to that value).  The patch was part of a cleanup series I
never got around to pushing...  I've reattached it here, but it probably
doesn't quite apply anymore.  I'll work on it over the weekend.

-- 
John Wright <jsw at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-deb822-Validate-input-in-Deb822.__setitem__.patch
Type: text/x-diff
Size: 2793 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20100917/d31ff085/attachment-0001.patch>


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