pycurl error reporting problem

Bug #56676 reported by Alex J. Champandard
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Vincent Ladeuil

Bug Description

The message from _pycurl.py in _raise_curl_connection_error is not always valid. Sometimes it prints "No error":

  File "lib/Bazaar-0.9\bzrlib\transport\http\_pycurl.py", line 223, in _curl_perform
    self._raise_curl_connection_error(curl)
  File "lib/Bazaar-0.9\bzrlib\transport\http\_pycurl.py", line 185, in _raise_curl_connection_error
    raise ConnectionError('curl connection error (%s: %s) on %s'
ConnectionError: Connection error: curl connection error (0: No error) on http://server.com/repository

In the caller function though, the "mutter" of variable "e" is correct, and catches errors like:

got pycurl error: 6, CURLE_COULDNT_RESOLVE_HOST

Revision history for this message
John A Meinel (jameinel) wrote :

I think the problem is that we use:

curl_errno = curl.getinfo(pycurl.OS_ERRNO)
and then
os.strerrno(curl_errno)

Which only can report errors that have a corresponding system errno.

It would be better for us to use the pycurl error object, as you mentioned.

This is a pretty small fix. Just change _raise_curl_connection_error to take a error object and use that rather than the curl object.

Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → v-ladeuil
Revision history for this message
Vincent Ladeuil (vila) wrote :

That was fixed some time ago and the fix is available in 0.13 (may be earlier).

Changed in bzr:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.