[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#545474: python-apt: Updating cache doesn't fail if host names cannot be resolved



On Sun, Aug 30, 2009 at 07:34:44PM +0200, Sebastian Heinlein wrote:
> Package: python-apt
> Version: 0.7.13.2
> Severity: normal
> 
> If the hostnames of remote repositories cannot be resolved updating the
> cache doesn't raise an exception.

The return value could be compared against
	ResultCancelled = 2,
        ResultContinue = 0,
        ResultFailed = 1
members of the acquire class.

We could do this kind of check automatically in apt.Cache and
raise an error if it is ResultFailed. The exception won't include
information about which item failed as this information is not
available from Update(). Something like this:

        if res == 2:
            raise FetchCancelledException()
        elif res == 1:
            raise FetchFailedException()
	else:
	    return res

The question remains whether this would break any other
package.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.



Reply to: