Comment 6 for bug 436182

Michael Nelson (michael.nelson) wrote :

Just trying to reproduce this locally - with a pristine sources.txt in the same directory in a python console:

{{{
f = open('sources.txt')
import apt_pkg
p = apt_pkg.ParseTagFile(f)
while p.Step() == 1:
   ver = p.Section['Package']
   src = p.Section['Version']

f.close()
}}}

Add *two* consecutive new-lines within the Binary: section as you like and save, then:

{{{
f = open('sources.txt')
p = apt_pkg.ParseTagFile(f)
while p.Step() == 1:
    src = p.Section['Package']
    ver = p.Section['Version']

}}}

The two consecutive new-lines results in:
Traceback (most recent call last):
  File "<console>", line 3, in ?
KeyError: 'Version'

But using just one new-line (as described in the bug) seems to work fine. This is with apt_pkg.Version == '0.7.20.2ubuntu6'.

I'll try to find out which version of apt-pkg is being used and verify the problem.