/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/transport/http/_urllib2_wrappers.py

Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
    # 8k chunks should be fine.
285
285
    _discarded_buf_size = 8192
286
286
 
 
287
    if PY3:
 
288
        def __init__(self, sock, debuglevel=0, method=None, url=None):
 
289
            self.url = url
 
290
            super(Response, self).__init__(sock, debuglevel=debuglevel,
 
291
                    method=method, url=url)
 
292
 
287
293
    def begin(self):
288
294
        """Begin to read the response from the server.
289
295
 
716
722
        exc_type, exc_val, exc_tb = sys.exc_info()
717
723
        if exc_type == socket.gaierror:
718
724
            # No need to retry, that will not help
 
725
            if PY3:
 
726
                origin_req_host = request.origin_req_host
 
727
            else:
 
728
                origin_req_host = request.get_origin_req_host()
719
729
            raise errors.ConnectionError("Couldn't resolve host '%s'"
720
 
                                         % request.get_origin_req_host(),
 
730
                                         % origin_req_host,
721
731
                                         orig_error=exc_val)
722
732
        elif isinstance(exc_val, http_client.ImproperConnectionState):
723
733
            # The http_client pipeline is in incorrect state, it's a bug in our