1. Tarek Ziadé
  2. distribute
  3. Issues
Issue #135 resolved

Patch: Better timeout error message

Florian Schulze
created an issue

in package_indes.py in process_url (line 192) you should use this:

f = self.open_url(url, "Download error on %s: %%s -- Some packages may not be found!" % url)

That way the error will include the url causing the timeout.

Comments (6)

  1. Alex Clark

    Except that doesn't actually work (it returns a "TypeError: not all arguments converted during string formatting" for some reason). What does seem to work is this:

    f = self.open_url(url)

    This causes a failure like so:

    $ bin/buildout
      Loading extensions.
      Getting distribution for 'buildout.dumppickedversions'.
    Error: Download error for http://svn.plone.org/svn/collective/buildout/buildout.dumppickedversions: timed out

    which is preferable to the status quo IMHO. Plus, folks (using zc.buildout, at least) can avoid timeouts like this via allow-hosts, e.g.:

    allow-hosts = 

    Can we please get a fix for this into 0.6.20? I'll do anything! :-)

  2. Alex Clark

    Remove extraneous 2nd argument in call to open_url, apparently intended to issue a warning (looks like open_url takes an optional `warning` argument, but I couldn't get that to work either). Fixes #135. This fix is better than the status quo, but probably not as good as issuing a warning instead of failure.


  3. Jason R. Coombs

    I'm concerned about this change - it fundamentally changes the control flow in package_index.PackageIndex.open_url. Now instead of issuing a warning, it will raise an exception instead of logging a warning. Note that at line 201, the warning is still passed.

    This issue doesn't currently capture what the failure was in the first place. What was the status quo, and why should it be changed?

  4. Jason R. Coombs

    I've created a different patch that incorporates the suggestion given in the ticket description. After applying the patch, it appears to be working as expected (i.e. no TypeError).

    PS C:\Users\jaraco\projects\public\distribute> easy_install -f http://arg.example.com/foo -H arg.example.com somepackage
    Searching for somepackage
    Reading http://arg.example.com/foo
    Download error on http://arg.example.com/foo: [Errno 11004] getaddrinfo failed -- Some packages may not be found!
    Link to http://pypi.python.org/simple/somepackage/ ***BLOCKED*** by --allow-hosts
    Couldn't find index page for 'somepackage' (maybe misspelled?)
    Scanning index of all packages (this may take a while)
    Link to http://pypi.python.org/simple/ ***BLOCKED*** by --allow-hosts
    No local packages or download links found for somepackage
    error: Could not find suitable distribution for Requirement.parse('somepackage')

    Alex, can you confirm this also addresses your needs?

  5. Log in to comment