Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8cd184c64 |
@@ -11,13 +11,13 @@ and swap the HTTP client while inheriting everything else.
|
||||
`requirements.txt`:
|
||||
|
||||
```
|
||||
aioweb @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb.git@v0.1.5
|
||||
aioweb @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb.git@v0.1.6
|
||||
```
|
||||
|
||||
Direct:
|
||||
|
||||
```bash
|
||||
pip install "aioweb @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb.git@v0.1.5"
|
||||
pip install "aioweb @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb.git@v0.1.6"
|
||||
```
|
||||
|
||||
Requires `aiohttp` and `yarl` (pulled transitively).
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "aioweb"
|
||||
version = "0.1.5"
|
||||
version = "0.1.6"
|
||||
description = "Async HTTP session wrapper over aiohttp — proxies, header overwrites, retries, previews. Config-free, installable."
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
@@ -306,6 +306,12 @@ class ExtendedSession:
|
||||
timeout = kwargs.get("timeout")
|
||||
if isinstance(timeout, (int, float)):
|
||||
kwargs["timeout"] = aiohttp.ClientTimeout(total=timeout)
|
||||
elif timeout is None and "timeout" in kwargs:
|
||||
# an explicit timeout=None reaches aiohttp as ClientTimeout(total=None),
|
||||
# which DISABLES the timeout and overrides the session default; drop it so
|
||||
# the session-level timeout applies (matters for request_with_retries, whose
|
||||
# timeout kwarg defaults to None)
|
||||
del kwargs["timeout"]
|
||||
|
||||
url = self._apply_domain_overwrites(url)
|
||||
if debug:
|
||||
@@ -335,6 +341,10 @@ class ExtendedSession:
|
||||
returns a Response on success (or non-retryable status), or a falsy
|
||||
FailureResponse if every attempt fails. backoff is exponential
|
||||
(backoff_base ** attempt).
|
||||
|
||||
timeout defaults to None, which falls back to the session-level timeout set
|
||||
at construction (aioweb pops a None timeout so it does not reach aiohttp as an
|
||||
infinite ClientTimeout); pass a number to override per call.
|
||||
"""
|
||||
attempts = attempts or DEFAULT_ATTEMPTS
|
||||
body_data, body_json = _route_body(data)
|
||||
|
||||
Reference in New Issue
Block a user