[BUG] AsyncTwilioHttpClient.request does not use self.timeout
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 815
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 2
Description
Describe the bug
AsyncTwilioHttpClient.request never falls back to self.timeout if timeout is None
Code snippet
if timeout is not None and timeout <= 0:
raise ValueError(timeout)
basic_auth = None
if auth is not None:
basic_auth = BasicAuth(login=auth[0], password=auth[1])
kwargs = {
"method": method.upper(),
"url": url,
"params": params,
"data": data,
"headers": headers,
"auth": basic_auth,
"timeout": timeout,
"allow_redirects": allow_redirects,
}
self.log_request(kwargs)
self._test_only_last_response = None
temp = False
session = None
if self.session:
session = self.session
else:
session = ClientSession()
temp = True
self._test_only_last_request = TwilioRequest(**kwargs)
response = await session.request(**kwargs)
Actual behavior
response is passed "timeout": None in kwargs instead of "timeout": self.timeout when no timeout argument is passed
Expected behavior
response is passed "timeout": self.timeout in kwargs when no timeout argument is passed, this is what (sync) TwilioHttpClient does:
if timeout is None:
timeout = self.timeout
elif timeout <= 0:
raise ValueError(timeout)
twilio-python version
9.10.9
Python version
3
Logs or error messages
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the AsyncTwilioHttpClient.request entry point shown in the issue and compare its timeout handling with TwilioHttpClient.request. Check the existing tests for these clients before making the change. Done means a missing timeout uses self.timeout while nonpositive explicit values still raise ValueError, with coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100