aiohttp 0.18.0
Major aiohttp release.
Added support for async for and async with, e.g.
async with client.get(url) as resp:
async for line in resp.content:
print(line)
auto-closes response object and iterates over response's content.
Server-side signals added (allows, for example, setup http headers for long-living responses in signal hook).
Python 3.3 support dropped.
Full list of changes is pretty huge:
Changes
-
Use errors.HttpProcessingError.message as HTTP error reason and
message #459 -
Optimize cythonized multidict a bit
-
Change repr's of multidicts and multidict views
-
default headers in ClientSession are now case-insensitive
-
Make '=' char and 'wss://' schema safe in urls #477
-
ClientResponse.close()forces connection closing by default from now #479
N.B. Backward incompatible change: was.close(force=False) Usingforceparameter for the method is deprecated: use.release()` instead. -
Properly requote URL's path #480
-
add
skip_auto_headersparameter for client API #486 -
Properly parse URL path in aiohttp.web.Request #489
-
Raise RuntimeError when chunked enabled and HTTP is 1.0 #488
-
Fix a bug with processing io.BytesIO as data parameter for client API #500
-
Skip auto-generation of Content-Type header #507
-
Use sendfile facility for static file handling #503
-
Default
response_factoryinapp.router.add_staticnow is
StreamResponse, notNone. The functionality is not changed if
default is not specified. -
Drop
ClientResponse.messageattribute, it was always implementation detail. -
Streams are optimized for speed and mostly memory in case of a big
HTTP message sizes #496 -
Fix a bug for server-side cookies for dropping cookie and setting it
again without Max-Age parameter. -
Don't trim redirect URL in client API #499
-
Extend precision of access log "D" to milliseconds #527
-
Deprecate
StreamResponse.start()method in favor of
StreamResponse.prepare()coroutine #525.start()is still supported but responses begun with.start()
doesn't call signal for response preparing to be sent. -
Add
StreamReader.__repr__ -
Drop Python 3.3 support, from now minimal required version is Python
3.4.1 #541 -
Add
async withsupport forClientSession.request()and family #536 -
Ignore message body on 204 and 304 responses #505
-
TCPConnectorprocessed both IPv4 and IPv6 by default #559 -
Add
.routes()view for urldispatcher #519 -
Route name should be a valid identifier name from now #567
-
Implement server signals #562
-
Drop an year-old deprecated files parameter from client API.
-
Added
async forsupport for aiohttp stream #542