Comment 4 for bug 984523

cleary (bernard-gray) wrote :

I've just replicated it on a random 12.04.4 server vm
My debootstrap command:
# debootstrap precise ./chroot

Then use the python commands as listed above, and the same error appears.

I've attached the output of the find command you requested

I also took this command, grep'd on ^d to filter directories, and did a diff against the same output on a trusty host with a trusty debootstrap. They have the same directories.

========================================

This is the same python commands run on the trusty host/trusty chroot (ie, how the precise output should look):
>>> import apt_pkg
>>> import apt
>>> apt_pkg.init_config()
>>> apt_pkg.config.set('RootDir', '/media/fll/chroot/')
>>> apt_pkg.config.set('APT::Architecture', 'amd64')
>>> apt_pkg.init_system()
>>> apt_pkg.Cache(apt.progress.base.OpProgress())
<apt_pkg.Cache object at 0x7f1fe1298518>
>>>

========================================

Output from precise 12.04.4 host with precise chroot:
>>> import apt_pkg
>>> import apt
>>> apt_pkg.init_config()
>>> apt_pkg.config.set('RootDir',
... '/root/chroot/')
>>> apt_pkg.config.set('APT::Architecture', 'amd64')
>>> apt_pkg.init_system()
>>> apt_pkg.Cache(apt.progress.base.OpProgress())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: E:Read error - read (21: Is a directory), E:The package lists or status file could not be parsed or opened.
>>>