[PATCH 6/6] Clarify a comment

John Wright jsw at debian.org
Wed Aug 5 07:42:59 UTC 2009


Hi Filippo,

On Sat, Aug 01, 2009 at 09:46:59AM +0100, Filippo Giunchedi wrote:
> On Wed, Jul 29, 2009 at 03:44:53PM +0200, John Wright wrote:
> > Only now I actually understand what the XXX comment was asking...
> > Really, we want to make sure that values don't end in a newline, or
> > we'll effectively be making a new stanza when we add the newline to it
> > here.
> > 
> > I wonder if it would actually make more sense to have a value-sanitizer
> > method, which basically returns value.strip() after first making sure
> > there are no empty lines in value.
> 
> is it going to be reused elsewhere? Perhaps clarifying the comment would be
> enough, adding a function call might slow down dump() at least AFAICT

How about just validating in Deb822.__setitem__?  This may slightly slow
down parsing without apt_pkg, but it won't have any effect when using
apt_pkg unless you change a field value after the fact.  It won't affect
dump() at all.

Patch attached for review.

-- 
John Wright <jsw at debian.org>


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