Bug#504413: KeyError: problem

John Wright jsw at debian.org
Mon Nov 3 18:27:52 UTC 2008


Hi Pietro,

On Mon, Nov 03, 2008 at 06:10:50PM +0100, Pietro Abate wrote:
> Package: python-debian
> Version: 0.1.11
> Severity: normal
> 
> 
> This snippet of code highligths this problem that is probably related to
> the fact that keys are saved at the class level and not at the instance
> level (something to do with shared_storage maybe ??).

I haven't looked too deep into this, but it doesn't happen when you call
iter_paragraphs with shared_storage=False.  If you still wish to use
apt_pkg to parse the Packages file, you can work around this issue for
now by making a copy of each paragraph, e.g. instead of

  pkglist[k] = pkg

do something like

  pkglist[k] = debian_bundle.deb822.Packages(pkg)

I'll try to see if it's possible to keep track of "old" apt_pkg-backed
objects without explicitly making copies, but I suspect that's a price
we pay for the fast parsing...

Thanks for the report!
-- 
John Wright <jsw at debian.org>





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