HTTPResponse.request is _RequestProxy type in 3.0 #718

Closed
codeb2cc opened this Issue Apr 8, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@codeb2cc
Contributor

codeb2cc commented Apr 8, 2013

I have some codes like:

if response.error and elapsed_time < TIMEOUT and retrial < MAX_RETRIAL:
    self._http_client.fetch(
        response.request,
        partial(self.on_response, callback=callback, retrial=retrial + 1),
    )

But in Tornado 3.0, HTTPResponse.request is now an instance of _RequestProxy instead of the old HTTPRequest. Codes above will not pass fetch's validation:

httpclient.py:170

if not isinstance(request, HTTPRequest):
    request = HTTPRequest(url=request, **kwargs)

Then url becomes an object and will raise an assertion error when try to _unicode. I think it's better to specify the change in DOC and release notes. Or maybe update the fetch to accept an _RequestProxy type request.

@bdarnell bdarnell closed this in 6e63b23 Apr 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment