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

Bug#680997: python-apt: Acquire.run returns 0 even in case of download error



Package: python-apt
Version: 0.8.6

apt_pkg.Acquire.run returns 0 (== RESULT_CONTINUE), even when some items failed to be downloaded. This is contrary to the documentation, which reads "RESULT_CONTINUE means that all items which where queued prior to calling
run() have been fetched successfully."

$ python test.py
Err non-existent
  404  Not Found [IP: 82.195.75.97 80]
Fetched 0 B in 0s (0 B/s)
.run() returned 0


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'experimental')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.4-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-apt depends on:
ii  libapt-inst1.5     0.9.7.1
ii  libapt-pkg4.12     0.9.7.1
ii  libc6              2.13-34
ii  libgcc1            1:4.7.1-3
ii  libstdc++6         4.7.1-3
ii  python             2.7.3-1
ii  python-apt-common  0.8.6
ii  python2.6          2.6.8-0.2
ii  python2.7          2.7.3-1

--
Jakub Wilk
import apt.progress
import apt_pkg

progress = apt.progress.text.AcquireProgress()
fetcher = apt_pkg.Acquire(progress)
file = apt_pkg.AcquireFile(fetcher,
    uri='http://debian.org/non-existent',
    descr='non-existent',
    destfile='/dev/null'
)
rc = fetcher.run()
print '.run() returned %d' % rc

Reply to: