--- Begin Message ---
Package: python-apt
Version: 1.1.0~alpha3
Test case:
- sudo touch /etc/apt/sources.list.d/bug.list
- sudo chmod 770 /etc/apt/sources.list.d/bug.list
- python -c "import apt; apt.Cache()"
That triggers a SystemError
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 113, in
__init__
self.open(progress)
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 164, in open
self._cache = apt_pkg.Cache(progress)
SystemError: E:Opening /etc/apt/sources.list.d/bugs.list -
ifstream::ifstream (13: Permission denied), E:The list of sources could
not be read., E:The package lists or status file could not be parsed or
opened.
The issue is hit sometimes by oneconf users on Ubuntu, see e.g
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1323586
--- End Message ---
--- Begin Message ---
On Wed, Sep 30, 2015 at 10:04:35AM +0200, Sebastien Bacher wrote:
> Package: python-apt
> Version: 1.1.0~alpha3
>
> Test case:
> - sudo touch /etc/apt/sources.list.d/bug.list
> - sudo chmod 770 /etc/apt/sources.list.d/bug.list
> - python -c "import apt; apt.Cache()"
>
> That triggers a SystemError
>
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 113, in
> __init__
> self.open(progress)
> File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 164, in open
> self._cache = apt_pkg.Cache(progress)
> SystemError: E:Opening /etc/apt/sources.list.d/bugs.list -
> ifstream::ifstream (13: Permission denied), E:The list of sources could
> not be read., E:The package lists or status file could not be parsed or
> opened.
>
> The issue is hit sometimes by oneconf users on Ubuntu, see e.g
> https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1323586
Unreadable sources.list files are an unsupported mode of operation
and will not be supported in neither APT nor python-apt (which
directly calls the functions from APT).
Authentication data should not be stored in sources.list files,
but in a netrc file. Using that, there's no need for unreadable
sources.list files.
If you cannot read a sources.list file, the state would be
inconsistent.
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Be friendly, do not top-post, and follow RFC 1855 "Netiquette".
- If you don't I might ignore you.
--- End Message ---