apt.Cache(rootdir="/foo") is honoured only for first instantiation of a Cache per-process
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
python-apt (Ubuntu) |
Fix Released
|
Undecided
|
Julian Andres Klode |
Bug Description
Binary package hint: python-apt
apt.Cache(
TEST CASE
$ python
>>> import apt
>>> apt.Cache(
...
SystemError: E:Could not open file /someboguspath/
>>> apt.Cache(
...(same exception again, still mentioning /someboguspath)...
Actually, looking into the source, instantiating an apt.Cache object appears to tweak process-global state of the apt_pkg library. If apt_pkg's global state cannot be adequately encapsulated by python-apt, it should be presented to the Python programmer in an obviously global way.
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: python-apt 0.7.9~exp2ubuntu3
ProcEnviron:
LC_COLLATE=C
PATH=(custom, user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: python-apt
Uname: Linux 2.6.28-5-generic i686
The problem seems to be somewhere in apt_pkg. Changes are accepted as soon as InitSystem() is called. This makes me believe the bug is in apt itself, in apt-pkg/ deb/debsystem. cc(debSystem: :AddStatusFiles ). The problem seems to be that the status file is only registered once.