[issue12366] packaging.pypi.dist should abstract download errors.

Michael Mulich report at bugs.python.org
Sun Jun 19 22:20:47 CEST 2011


New submission from Michael Mulich <michael.mulich at gmail.com>:

packaging.pypi.dist should abstract download errors, especially those from external sources. Download errors are currently reported from urllib. We should probably be using packaging.errors.PackagingPyPIError in this situation. Other suggestions?

Example case:

sake version 0.0.0 has a external download URL that throws a 404 (see also http://pypi.python.org/simple/sake/). When attempting to download this release, we receive a ValueError from urllib, which is not very detailed and could mean a number of things.

Traceback (most recent call last):
  ... [dev project] ...
  File ".../cpython/Lib/packaging/pypi/dist.py", line 167, in download
    .download(path=temp_path)
  File ".../cpython/Lib/packaging/pypi/dist.py", line 302, in download
    path + "/" + archive_name)
  File ".../cpython/Lib/urllib/request.py", line 150, in urlretrieve
    return _urlopener.retrieve(url, filename, reporthook, data)
  File ".../cpython/Lib/urllib/request.py", line 1600, in retrieve
    block = fp.read(bs)
ValueError: read of closed file

----------
assignee: tarek
components: Distutils2
messages: 138658
nosy: alexis, eric.araujo, michael.mulich, tarek
priority: normal
severity: normal
status: open
title: packaging.pypi.dist should abstract download errors.
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12366>
_______________________________________


More information about the Python-bugs-list mailing list