Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Reset response to None when following a redirect. #807

Merged
merged 1 commit into from

2 participants

@tpodowd
  • if a request which follows a redirect throws a HTTPException and we're out of retries, the real exception is hidden because the response from the previous redirect is still set. Resetting the response to None, allows us to see any real exception.
Thomas O'Dowd Reset response to None when following a redirect.
- if a request which follows a redirect throws a HTTPException
  and we're out of retries, the real exception is hidden because
  the response from the previous redirect is still set. Resetting
  the response to None, allows us to see any real exception.
29f0f24
@tpodowd

Shouldn't break anything. Here's an s3 test run.

$ ./test.py -t s3
--- running S3Connection tests ---
--- tests completed ---
.................--- running S3Encryption tests ---
--- tests completed ---

.............

Ran 30 tests in 178.457s

OK

@tpodowd

Also note that redirects don't count towards a retry so we always do one more request. This is why it's ok to do this here.

Tom.

@garnaat garnaat merged commit bc05cb1 into boto:develop
@tpodowd

Thanks Mitch.

Tom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 11, 2012
  1. Reset response to None when following a redirect.

    Thomas O'Dowd authored
    - if a request which follows a redirect throws a HTTPException
      and we're out of retries, the real exception is hidden because
      the response from the previous redirect is still set. Resetting
      the response to None, allows us to see any real exception.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  boto/connection.py
View
1  boto/connection.py
@@ -782,6 +782,7 @@ def _mexe(self, request, sender=None, override_num_retries=None,
boto.log.debug(msg)
connection = self.get_http_connection(request.host,
scheme == 'https')
+ response = None
continue
except self.http_exceptions, e:
for unretryable in self.http_unretryable_exceptions:
Something went wrong with that request. Please try again.