[Bug 792295] [NEW] Cache(rootdir) needs to be absolute

Loïc Minier lool at dooz.org
Fri Jun 3 10:42:56 UTC 2011


Public bug reported:

Binary package hint: python-apt

Hi

When instanciating an apt.Cache with a rootdir, it will break if it's not absolute:
mkdir -p apt-test/etc/apt
cp /etc/apt/sources.list* -a apt-test/etc/apt
% python

Python 2.7.2rc1 (default, May 31 2011, 11:34:02) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import apt
>>> apt.Cache(rootdir='apt-test')
creating:  apt-test/var/lib/dpkg
creating:  apt-test/var/cache/apt/archives/partial
creating:  apt-test/var/lib/apt/lists/partial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 93, in __init__
    self.open(progress)
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 136, in open
    self._cache = apt_pkg.Cache(progress)
SystemError: E:Could not open file apt-test/var/lib/apt/apt-test/var/lib/dpkg/status - open (2: No such file or directory), E:The package lists or status file could not be parsed or opened.

this with oneiric, apt 0.8.14.1ubuntu5 and python-apt 0.8.0~exp4ubuntu1.

apt.conf RootDir and python-apt's Cache.__doc__ don't say rootdir needs
to be absolute; perhaps some piece of apt is broken WRT to rootdir,
perhaps python-apt should make the path absolute, or perhaps the docs
need to be updated to require an absolute dir.

Cheers,

** Affects: python-apt (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-apt in Ubuntu.
https://bugs.launchpad.net/bugs/792295

Title:
  Cache(rootdir) needs to be absolute

Status in “python-apt” package in Ubuntu:
  New

Bug description:
  Binary package hint: python-apt

  Hi

  When instanciating an apt.Cache with a rootdir, it will break if it's not absolute:
  mkdir -p apt-test/etc/apt
  cp /etc/apt/sources.list* -a apt-test/etc/apt
  % python

  Python 2.7.2rc1 (default, May 31 2011, 11:34:02) 
  [GCC 4.6.1] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import apt
  >>> apt.Cache(rootdir='apt-test')
  creating:  apt-test/var/lib/dpkg
  creating:  apt-test/var/cache/apt/archives/partial
  creating:  apt-test/var/lib/apt/lists/partial
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 93, in __init__
      self.open(progress)
    File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 136, in open
      self._cache = apt_pkg.Cache(progress)
  SystemError: E:Could not open file apt-test/var/lib/apt/apt-test/var/lib/dpkg/status - open (2: No such file or directory), E:The package lists or status file could not be parsed or opened.

  this with oneiric, apt 0.8.14.1ubuntu5 and python-apt
  0.8.0~exp4ubuntu1.

  apt.conf RootDir and python-apt's Cache.__doc__ don't say rootdir
  needs to be absolute; perhaps some piece of apt is broken WRT to
  rootdir, perhaps python-apt should make the path absolute, or perhaps
  the docs need to be updated to require an absolute dir.

  Cheers,




More information about the foundations-bugs mailing list