Bug#538376: python-debian: debian_bundle parses some multilines fields inconsistantly

John Wright jsw at debian.org
Sun Jul 26 13:07:18 UTC 2009


On Sun, Jul 26, 2009 at 12:34:47PM +0200, Stefano Zacchiroli wrote:
> On Sat, Jul 25, 2009 at 07:38:57PM +0200, John Wright wrote:
> > I'm actually inclined to turn off using apt_pkg by default.  It's
> > definitely faster, typically by a factor between 2 and 2.5, but we
> > keep running into weird corner cases with the way apt_pkg parses
> > things.
> <snip>
> > Clearly, using shared storage (which basically just means using
> > apt_pkg's parser.Section directly) is blazingly fast compared to
> > without.  But this is aready not the default, since it has the
> > confusing side-effect of making the object returned by each
> > iteration (each of which has a different id) actually share the same
> > data.
> > 
> > Is anybody strongly opposed to making iter_paragraphs not use
> > apt_pkg by default?  I'm still trying to figure out a way to salvage
> > the output from apt_pkg in this case, but I'm not having much luck.
> 
> I'm not against changing the default. However, I'm against making it
> difficult / undocumented how to use apt_pkg + shared storage. I do
> care about runtimes but I want to retain the nice data structures of
> deb822 nevertheless (i.e. please not make me use python-apt all
> alone).
> 
> What it might make sense then is to have different top level
> functions, with one maybe marked "fast" and well documenting that it
> has potential drawback. The other can safely be our, slower, default.

I don't quite understand what you mean.  Are you thinking of a method
like deb822.Deb822.iter_paragraphs_fast(...), which is basically a
wrapper around iter_paragraphs with use_apt_pkg=True and
shared_storage=True?

I wouldn't be opposed to something like that.  Somehow, we just need to
make it clear that using the "native" parser, which is slower than
apt_pkg, is the only way to guarantee that modifying a Deb822 object and
then dumping it back out will produce output consistent with the input.

I really wish it were possible to ensure the apt_pkg parser gave the
same results as the native parser, though. :(

-- 
John Wright <jsw at debian.org>





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