The apt-cache code should only run if /usr/share/python/debian_defaults DNE; it's included in python-minimal. I wonder why Peter's system doesn't have it?
This use of apt-cache as a fallback seems very dodgy, it makes assumptions about the system being configured to use apt and about apt being set up so that the correct version of python-all is the candidate version. These assumptions seem like the kind of thing that could break in interesting setups, or just on systems that don't use apt.. -- see shy jo
signature.asc
Description: Digital signature