NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #51 most downloaded on PyPI
Async http client/server framework (asyncio)
Last release 2 months ago
23 Jul 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
7 versions withdrawn
withdrawn after publishing
13 years old
312 releases · first in 2013
Removals and backward incompatible breaking changes
Raise aiohttp.ServerFingerprintMismatch exception on client-side if request through http proxy with mismatching server fingerprint digest: aiohttp.ClientSession(headers=headers, connector=TCPConnector(ssl=aiohttp.Fingerprint(mismatch_digest), trust_env=True).request(...) -- by gangj.
Related issues and pull requests on GitHub: #6652.
Made TestClient.app a Generic so type checkers will know the correct type (avoiding unneeded client.app is not None checks) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8977.
Authentication provided by a redirect now takes precedence over provided auth when making requests with the client -- by PLPeeters.
Related issues and pull requests on GitHub: #9436.
Added strategy parameter to aiohttp.web.StreamResponse.enable_compression The value of this parameter is passed to the zlib.compressobj function, allowing people to use a more sufficient compression algorithm for their data served by aiohttp.web -- by shootkin
Related issues and pull requests on GitHub: #6257.
Added server_hostname parameter to ws_connect.
Related issues and pull requests on GitHub: #7941.
Exported ~aiohttp.ClientWSTimeout to top-level namespace -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8612.
Added secure/httponly/samesite parameters to .del_cookie() -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8956.
Updated ~aiohttp.ClientSession's auth logic to include default auth only if the request URL's origin matches _base_url; otherwise, the auth will not be included -- by MaximZemskov
Related issues and pull requests on GitHub: #8966, #9466.
Added proxy and proxy_auth parameters to ~aiohttp.ClientSession -- by meshya.
Related issues and pull requests on GitHub: #9207.
Added default_to_multipart parameter to FormData.
Related issues and pull requests on GitHub: #9335.
Added ~aiohttp.ClientWebSocketResponse.send_frame and ~aiohttp.web.WebSocketResponse.send_frame for WebSockets -- by bdraco.
Related issues and pull requests on GitHub: #9348.
Updated ~aiohttp.ClientSession to support paths in base_url parameter. base_url paths must end with a / -- by Cycloctane.
Related issues and pull requests on GitHub: #9530.
Improved performance of reading WebSocket messages with a Cython implementation -- by bdraco.
Related issues and pull requests on GitHub: #9543, #9554, #9556, #9558, #9636, #9649.
Added writer_limit to the ~aiohttp.web.WebSocketResponse to be able to adjust the limit before the writer forces the buffer to be drained -- by bdraco.
Related issues and pull requests on GitHub: #9572.
Deprecate obsolete timeout: float and receive_timeout: Optional[float] in ~aiohttp.ClientSession.ws_connect. Change default websocket receive timeout from None to 10.0.
Related issues and pull requests on GitHub: #3945.
Dropped support for Python 3.8 -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8797.
Increased minimum yarl version to 1.17.0 -- by bdraco.
Related issues and pull requests on GitHub: #8909, #9079, #9305, #9574.
Removed the is_ipv6_address and is_ip4_address helpers are they are no longer used -- by bdraco.
Related issues and pull requests on GitHub: #9344.
Changed ClientRequest.connection_key to be a NamedTuple to improve client performance -- by bdraco.
Related issues and pull requests on GitHub: #9365.
Improved performance of the connector when a connection can be reused -- by bdraco.
If BaseConnector.connect has been subclassed and replaced with custom logic, the ceil_timeout must be added.
Related issues and pull requests on GitHub: #9600.
Switched to using the propcache package for property caching -- by bdraco.
The propcache package is derived from the property caching code in yarl and has been broken out to avoid maintaining it for multiple projects.
Related issues and pull requests on GitHub: #9394.
Separated aiohttp.http_websocket into multiple files to make it easier to maintain -- by bdraco.
Related issues and pull requests on GitHub: #9542, #9552.
Changed diagram images generator from blockdiag to GraphViz. Generating documentation now requires the GraphViz executable to be included in $PATH or sphinx build configuration.
Related issues and pull requests on GitHub: #9359.
Added flake8 settings to avoid some forms of implicit concatenation. -- by booniepepper.
Related issues and pull requests on GitHub: #7731.
Enabled keep-alive support on proxies (which was originally disabled several years ago) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8920.
Changed web entry point to not listen on TCP when only a Unix path is passed -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9033.
Disabled automatic retries of failed requests in aiohttp.test_utils.TestClient's client session (which could potentially hide errors in tests) -- by ShubhAgarwal-dev.
Related issues and pull requests on GitHub: #9141.
Changed web keepalive_timeout default to around an hour in order to reduce race conditions on reverse proxies -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9285.
Reduced memory required for stream objects created during the client request lifecycle -- by bdraco.
Related issues and pull requests on GitHub: #9407.
Improved performance of the client request lifecycle when there are no cookies -- by bdraco.
Related issues and pull requests on GitHub: #9470.
Improved performance of sending client requests when the writer can finish synchronously -- by bdraco.
Related issues and pull requests on GitHub: #9485.
Improved performance of serializing HTTP headers -- by bdraco.
Related issues and pull requests on GitHub: #9603.
## Performance
WebSocket reader performance has improved ~60% since b1
aiohttp 3.10.0 yarl 1.9.5 
aiohttp 3.11.0b0 yarl 1.17.0 
aiohttp 3.11.0b1 yarl 1.17.1 (no change from b1) 
One column per quarter.
Removals and backward incompatible breaking changes
Raise aiohttp.ServerFingerprintMismatch exception on client-side if request through http proxy with mismatching server fingerprint digest: aiohttp.ClientSession(headers=headers, connector=TCPConnector(ssl=aiohttp.Fingerprint(mismatch_digest), trust_env=True).request(...) -- by gangj.
Related issues and pull requests on GitHub: #6652.
Made TestClient.app a Generic so type checkers will know the correct type (avoiding unneeded client.app is not None checks) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8977.
Authentication provided by a redirect now takes precedence over provided auth when making requests with the client -- by PLPeeters.
Related issues and pull requests on GitHub: #9436.
Added strategy parameter to aiohttp.web.StreamResponse.enable_compression The value of this parameter is passed to the zlib.compressobj function, allowing people to use a more sufficient compression algorithm for their data served by aiohttp.web -- by shootkin
Related issues and pull requests on GitHub: #6257.
Added server_hostname parameter to ws_connect.
Related issues and pull requests on GitHub: #7941.
Exported ~aiohttp.ClientWSTimeout to top-level namespace -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8612.
Added secure/httponly/samesite parameters to .del_cookie() -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8956.
Updated ~aiohttp.ClientSession's auth logic to include default auth only if the request URL's origin matches _base_url; otherwise, the auth will not be included -- by MaximZemskov
Related issues and pull requests on GitHub: #8966, #9466.
Added proxy and proxy_auth parameters to ~aiohttp.ClientSession -- by meshya.
Related issues and pull requests on GitHub: #9207.
Added default_to_multipart parameter to FormData.
Related issues and pull requests on GitHub: #9335.
Added ~aiohttp.ClientWebSocketResponse.send_frame and ~aiohttp.web.WebSocketResponse.send_frame for WebSockets -- by bdraco.
Related issues and pull requests on GitHub: #9348.
Updated ~aiohttp.ClientSession to support paths in base_url parameter. base_url paths must end with a / -- by Cycloctane.
Related issues and pull requests on GitHub: #9530.
Improved performance of reading WebSocket messages with a Cython implementation -- by bdraco.
Related issues and pull requests on GitHub: #9543, #9554, #9556, #9558.
Added writer_limit to the ~aiohttp.web.WebSocketResponse to be able to adjust the limit before the writer forces the buffer to be drained -- by bdraco.
Related issues and pull requests on GitHub: #9572.
Deprecate obsolete timeout: float and receive_timeout: Optional[float] in ~aiohttp.ClientSession.ws_connect. Change default websocket receive timeout from None to 10.0.
Related issues and pull requests on GitHub: #3945.
Dropped support for Python 3.8 -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8797.
Increased minimum yarl version to 1.17.0 -- by bdraco.
Related issues and pull requests on GitHub: #8909, #9079, #9305, #9574.
Removed the is_ipv6_address and is_ip4_address helpers are they are no longer used -- by bdraco.
Related issues and pull requests on GitHub: #9344.
Changed ClientRequest.connection_key to be a NamedTuple to improve client performance -- by bdraco.
Related issues and pull requests on GitHub: #9365.
Improved performance of the connector when a connection can be reused -- by bdraco.
If BaseConnector.connect has been subclassed and replaced with custom logic, the ceil_timeout must be added.
Related issues and pull requests on GitHub: #9600.
Switched to using the propcache package for property caching -- by bdraco.
The propcache package is derived from the property caching code in yarl and has been broken out to avoid maintaining it for multiple projects.
Related issues and pull requests on GitHub: #9394.
Separated aiohttp.http_websocket into multiple files to make it easier to maintain -- by bdraco.
Related issues and pull requests on GitHub: #9542, #9552.
Changed diagram images generator from blockdiag to GraphViz. Generating documentation now requires the GraphViz executable to be included in $PATH or sphinx build configuration.
Related issues and pull requests on GitHub: #9359.
Added flake8 settings to avoid some forms of implicit concatenation. -- by booniepepper.
Related issues and pull requests on GitHub: #7731.
Enabled keep-alive support on proxies (which was originally disabled several years ago) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8920.
Changed web entry point to not listen on TCP when only a Unix path is passed -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9033.
Disabled automatic retries of failed requests in aiohttp.test_utils.TestClient's client session (which could potentially hide errors in tests) -- by ShubhAgarwal-dev.
Related issues and pull requests on GitHub: #9141.
Changed web keepalive_timeout default to around an hour in order to reduce race conditions on reverse proxies -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9285.
Reduced memory required for stream objects created during the client request lifecycle -- by bdraco.
Related issues and pull requests on GitHub: #9407.
Improved performance of the client request lifecycle when there are no cookies -- by bdraco.
Related issues and pull requests on GitHub: #9470.
Improved performance of sending client requests when the writer can finish synchronously -- by bdraco.
Related issues and pull requests on GitHub: #9485.
Improved performance of serializing HTTP headers -- by bdraco.
Related issues and pull requests on GitHub: #9603.
## Performance aiohttp 3.10.0 yarl 1.9.5 
aiohttp 3.11.0b0 yarl 1.17.0 
aiohttp 3.11.0b1 yarl 1.17.1 
Removals and backward incompatible breaking changes
Raise aiohttp.ServerFingerprintMismatch exception on client-side if request through http proxy with mismatching server fingerprint digest: aiohttp.ClientSession(headers=headers, connector=TCPConnector(ssl=aiohttp.Fingerprint(mismatch_digest), trust_env=True).request(...) -- by gangj.
Related issues and pull requests on GitHub: #6652.
Made TestClient.app a Generic so type checkers will know the correct type (avoiding unneeded client.app is not None checks) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8977.
Authentication provided by a redirect now takes precedence over provided auth when making requests with the client -- by PLPeeters.
Related issues and pull requests on GitHub: #9436.
Added strategy parameter to aiohttp.web.StreamResponse.enable_compression The value of this parameter is passed to the zlib.compressobj function, allowing people to use a more sufficient compression algorithm for their data served by aiohttp.web -- by shootkin
Related issues and pull requests on GitHub: #6257.
Exported ~aiohttp.ClientWSTimeout to top-level namespace -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8612.
Added secure/httponly/samesite parameters to .del_cookie() -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8956.
Updated ~aiohttp.ClientSession's auth logic to include default auth only if the request URL's origin matches _base_url; otherwise, the auth will not be included -- by MaximZemskov
Related issues and pull requests on GitHub: #8966, #9466.
Added proxy and proxy_auth parameters to ~aiohttp.ClientSession -- by meshya.
Related issues and pull requests on GitHub: #9207.
Added default_to_multipart parameter to FormData.
Related issues and pull requests on GitHub: #9335.
Added ~aiohttp.ClientWebSocketResponse.send_frame and ~aiohttp.web.WebSocketResponse.send_frame for WebSockets -- by bdraco.
Related issues and pull requests on GitHub: #9348.
Improved performance of reading WebSocket messages with a Cython implementation -- by bdraco.
Related issues and pull requests on GitHub: #9543, #9554, #9556, #9558.
Added writer_limit to the ~aiohttp.web.WebSocketResponse to be able to adjust the limit before the writer forces the buffer to be drained -- by bdraco.
Related issues and pull requests on GitHub: #9572.
Deprecate obsolete timeout: float and receive_timeout: Optional[float] in ~aiohttp.ClientSession.ws_connect. Change default websocket receive timeout from None to 10.0.
Related issues and pull requests on GitHub: #3945.
Dropped support for Python 3.8 -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8797.
Increased minimum yarl version to 1.17.0 -- by bdraco.
Related issues and pull requests on GitHub: #8909, #9079, #9305, #9574.
Removed the is_ipv6_address and is_ip4_address helpers are they are no longer used -- by bdraco.
Related issues and pull requests on GitHub: #9344.
Changed ClientRequest.connection_key to be a NamedTuple to improve client performance -- by bdraco.
Related issues and pull requests on GitHub: #9365.
Switched to using the propcache package for property caching -- by bdraco.
The propcache package is derived from the property caching code in yarl and has been broken out to avoid maintaining it for multiple projects.
Related issues and pull requests on GitHub: #9394.
Separated aiohttp.http_websocket into multiple files to make it easier to maintain -- by bdraco.
Related issues and pull requests on GitHub: #9542, #9552.
Changed diagram images generator from blockdiag to GraphViz. Generating documentation now requires the GraphViz executable to be included in $PATH or sphinx build configuration.
Related issues and pull requests on GitHub: #9359.
Added flake8 settings to avoid some forms of implicit concatenation. -- by booniepepper.
Related issues and pull requests on GitHub: #7731.
Enabled keep-alive support on proxies (which was originally disabled several years ago) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8920.
Changed web entry point to not listen on TCP when only a Unix path is passed -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9033.
Disabled automatic retries of failed requests in aiohttp.test_utils.TestClient's client session (which could potentially hide errors in tests) -- by ShubhAgarwal-dev.
Related issues and pull requests on GitHub: #9141.
Changed web keepalive_timeout default to around an hour in order to reduce race conditions on reverse proxies -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9285.
Reduced memory required for stream objects created during the client request lifecycle -- by bdraco.
Related issues and pull requests on GitHub: #9407.
Improved performance of the client request lifecycle when there are no cookies -- by bdraco.
Related issues and pull requests on GitHub: #9470.
Improved performance of sending client requests when the writer can finish synchronously -- by bdraco.
Related issues and pull requests on GitHub: #9485.
aiohttp 3.10.0 yarl 1.9.5 
aiohttp 3.11.0b0 yarl 1.17.0 
Removals and backward incompatible breaking changes
Authentication provided by a redirect now takes precedence over provided auth when making requests with the client -- by PLPeeters.
Related issues and pull requests on GitHub: #9436.
Fixed WebSocketResponse.close() to discard non-close messages within its timeout window after sending close -- by lenard-mosys.
Related issues and pull requests on GitHub: #9506.
Fixed a deadlock that could occur while attempting to get a new connection slot after a timeout -- by bdraco.
The connector was not cancellation-safe.
Related issues and pull requests on GitHub: #9670, #9671.
Fixed the WebSocket flow control calculation undercounting with multi-byte data -- by bdraco.
Related issues and pull requests on GitHub: #9686.
Fixed incorrect parsing of chunk extensions with the pure Python parser -- by bdraco.
Related issues and pull requests on GitHub: #9851.
Fixed system routes polluting the middleware cache -- by bdraco.
Related issues and pull requests on GitHub: #9852.
Improved performance of the connector when a connection can be reused -- by bdraco.
If BaseConnector.connect has been subclassed and replaced with custom logic, the ceil_timeout must be added.
Related issues and pull requests on GitHub: #9600.
Improved performance of the client request lifecycle when there are no cookies -- by bdraco.
Related issues and pull requests on GitHub: #9470.
Improved performance of sending client requests when the writer can finish synchronously -- by bdraco.
Related issues and pull requests on GitHub: #9485.
Improved performance of serializing HTTP headers -- by bdraco.
Related issues and pull requests on GitHub: #9603.
Passing enable_cleanup_closed to aiohttp.TCPConnector is now ignored on Python 3.12.7+ and 3.13.1+ since the underlying bug that caused asyncio to leak SSL connections has been fixed upstream -- by bdraco.
Related issues and pull requests on GitHub: #9726, #9736.
Removals and backward incompatible breaking changes
Authentication provided by a redirect now takes precedence over provided auth when making requests with the client -- by PLPeeters.
Related issues and pull requests on GitHub: #9436.
Fixed WebSocketResponse.close() to discard non-close messages within its timeout window after sending close -- by lenard-mosys.
Related issues and pull requests on GitHub: #9506.
Fixed a deadlock that could occur while attempting to get a new connection slot after a timeout -- by bdraco.
The connector was not cancellation-safe.
Related issues and pull requests on GitHub: #9670, #9671.
Fixed the WebSocket flow control calculation undercounting with multi-byte data -- by bdraco.
Related issues and pull requests on GitHub: #9686.
Improved performance of the connector when a connection can be reused -- by bdraco.
If BaseConnector.connect has been subclassed and replaced with custom logic, the ceil_timeout must be added.
Related issues and pull requests on GitHub: #9600.
Improved performance of the client request lifecycle when there are no cookies -- by bdraco.
Related issues and pull requests on GitHub: #9470.
Improved performance of sending client requests when the writer can finish synchronously -- by bdraco.
Related issues and pull requests on GitHub: #9485.
Improved performance of serializing HTTP headers -- by bdraco.
Related issues and pull requests on GitHub: #9603.
Passing enable_cleanup_closed to aiohttp.TCPConnector is now ignored on Python 3.12.7+ and 3.13.1+ since the underlying bug that caused asyncio to leak SSL connections has been fixed upstream -- by bdraco.
Related issues and pull requests on GitHub: #9726, #9736.
Fixed error messages from class:~aiohttp.resolver.AsyncResolver being swallowed -- by bdraco.
Fixed error messages from ~aiohttp.resolver.AsyncResolver being swallowed -- by bdraco.
Related issues and pull requests on GitHub: #9451, #9455.
Added aiohttp.ClientConnectorDNSError for differentiating DNS resolution errors from other connector errors -- by mstojcevich.
Related issues and pull requests on GitHub: #8455.
Simplified DNS resolution throttling code to reduce chance of race conditions -- by bdraco.
Related issues and pull requests on GitHub: #9454.
Removals and backward incompatible breaking changes
Fixed proxy headers being used in the ConnectionKey hash when a proxy was not being used -- by bdraco.
If default headers are used, they are also used for proxy headers. This could have led to creating connections that were not needed when one was already available.
Related issues and pull requests on GitHub: #9368.
Widened the type of the trace_request_ctx parameter of ClientSession.request() and friends -- by layday.
Related issues and pull requests on GitHub: #9397.
Fixed failure to try next host after single-host connection timeout -- by brettdh.
The default client aiohttp.ClientTimeout params has changed to include a sock_connect timeout of 30 seconds so that this correct behavior happens by default.
Related issues and pull requests on GitHub: #7342.
Improved performance of resolving hosts with Python 3.12+ -- by bdraco.
Related issues and pull requests on GitHub: #9342.
Reduced memory required for timer objects created during the client request lifecycle -- by bdraco.
Related issues and pull requests on GitHub: #9406.
Fixed cancellation leaking upwards on timeout -- by bdraco.
Fixed cancellation leaking upwards on timeout -- by :user:bdraco.
Related issues and pull requests on GitHub: #9326.
Fixed assembling the ~yarl.URL for web requests when the host contains a non-default port or IPv6 address -- by bdraco.
Fixed assembling the ~yarl.URL for web requests when the host contains a non-default port or IPv6 address -- by bdraco.
Related issues and pull requests on GitHub: #9309.
Improved performance of determining if a URL is absolute -- by bdraco.
The property ~yarl.URL.absolute is more performant than the method URL.is_absolute() and preferred when newer versions of yarl are used.
Related issues and pull requests on GitHub: #9171.
Replaced code that can now be handled by yarl -- by bdraco.
Related issues and pull requests on GitHub: #9301.
Removals and backward incompatible breaking changes
Added aiohttp.ClientConnectionResetError. Client code that previously threw ConnectionResetError will now throw this -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9137.
Fixed an unclosed transport ResourceWarning on web handlers -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8875.
Fixed resolve_host() 'Task was destroyed but is pending' errors -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8967.
Fixed handling of some file-like objects (e.g. tarfile.extractfile()) which raise AttributeError instead of OSError when fileno fails for streaming payload data -- by ReallyReivax.
Related issues and pull requests on GitHub: #6732.
Fixed web router not matching pre-encoded URLs (requires yarl 1.9.6+) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8898, #9267.
Fixed an error when trying to add a route for multiple methods with a path containing a regex pattern -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8998.
Fixed Response.text when body is a Payload -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #6485.
Fixed compressed requests failing when no body was provided -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9108.
Fixed client incorrectly reusing a connection when the previous message had not been fully sent -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8992.
Fixed race condition that could cause server to close connection incorrectly at keepalive timeout -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9140.
Fixed Python parser chunked handling with multiple Transfer-Encoding values -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8823.
Fixed error handling after 100-continue so server sends 500 response instead of disconnecting -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8876.
Stopped adding a default Content-Type header when response has no content -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8858.
Added support for URL credentials with empty (zero-length) username, e.g. https://:password@host -- by shuckc
Related issues and pull requests on GitHub: #6494.
Stopped logging exceptions from web.run_app() that would be raised regardless -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #6807.
Implemented binding to IPv6 addresses in the pytest server fixture.
Related issues and pull requests on GitHub: #4650.
Fixed the incorrect use of flags for getnameinfo() in the Resolver --by GitNMLee
Link-Local IPv6 addresses can now be handled by the Resolver correctly.
Related issues and pull requests on GitHub: #9032.
Fixed StreamResponse.prepared to return True after EOF is sent -- by arthurdarcet.
Related issues and pull requests on GitHub: #5343.
Changed make_mocked_request() to use empty payload by default -- by rahulnht.
Related issues and pull requests on GitHub: #7167.
Used more precise type for ClientResponseError.headers, fixing some type errors when using them -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8768.
Changed behavior when returning an invalid response to send a 500 response -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8845.
Fixed response reading from closed session to throw an error immediately instead of timing out -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8878.
Fixed CancelledError from one cleanup context stopping other contexts from completing -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8908.
Fixed changing scheme/host in Response.clone() for absolute URLs -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8990.
Fixed Site.name when host is an empty string -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8929.
Updated Python parser to reject messages after a close message, matching C parser behaviour -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9018.
Fixed creation of SSLContext inside of aiohttp.TCPConnector with multiple event loops in different threads -- by bdraco.
Related issues and pull requests on GitHub: #9029.
Fixed (on Python 3.11+) some edge cases where a task cancellation may get incorrectly suppressed -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9030.
Fixed exception information getting lost on HttpProcessingError -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9052.
Fixed If-None-Match not using weak comparison -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9063.
Fixed badly encoded charset crashing when getting response text instead of falling back to charset detector.
Related issues and pull requests on GitHub: #9160.
Rejected n in reason values to avoid sending broken HTTP messages -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9167.
Changed ClientResponse.raise_for_status() to only release the connection when invoked outside an async with context -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9239.
Improved type on params to match the underlying type allowed by yarl -- by lpetre.
Related issues and pull requests on GitHub: #8564.
Declared Python 3.13 supported -- by bdraco.
Related issues and pull requests on GitHub: #8748.
Improved middleware performance -- by bdraco.
The set_current_app method was removed from UrlMappingMatchInfo because it is no longer used, and it was unlikely external caller would ever use it.
Related issues and pull requests on GitHub: #9200.
Increased minimum yarl version to 1.12.0 -- by bdraco.
Related issues and pull requests on GitHub: #9267.
Clarified that GracefulExit needs to be handled in AppRunner and ServerRunner when using handle_signals=True. -- by Daste745
Related issues and pull requests on GitHub: #4414.
Clarified that auth parameter in ClientSession will persist and be included with any request to any origin, even during redirects to different origins. -- by MaximZemskov.
Related issues and pull requests on GitHub: #6764.
Clarified which timeout exceptions happen on which timeouts -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8968.
Updated ClientSession parameters to match current code -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8991.
Fixed test_client_session_timeout_zero to not require internet access -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9004.
Improved performance of making requests when there are no auto headers to skip -- by bdraco.
Related issues and pull requests on GitHub: #8847.
Exported aiohttp.TraceRequestHeadersSentParams -- by Hadock-is-ok.
Related issues and pull requests on GitHub: #8947.
Avoided tracing overhead in the http writer when there are no active traces -- by user:bdraco.
Related issues and pull requests on GitHub: #9031.
Improved performance of reify Cython implementation -- by bdraco.
Related issues and pull requests on GitHub: #9054.
Use URL.extend_query() to extend query params (requires yarl 1.11.0+) -- by bdraco.
If yarl is older than 1.11.0, the previous slower hand rolled version will be used.
Related issues and pull requests on GitHub: #9068.
Improved performance of checking if a host is an IP Address -- by bdraco.
Related issues and pull requests on GitHub: #9095.
Significantly improved performance of middlewares -- by bdraco.
The construction of the middleware wrappers is now cached and is built once per handler instead of on every request.
Related issues and pull requests on GitHub: #9158, #9170.
Improved performance of web requests -- by bdraco.
Related issues and pull requests on GitHub: #9168, #9169, #9172, #9174, #9175, #9241.
Improved performance of starting web requests when there is no response prepare hook -- by bdraco.
Related issues and pull requests on GitHub: #9173.
Significantly improved performance of expiring cookies -- by bdraco.
Expiring cookies has been redesigned to use heapq instead of a linear search, to better scale.
Related issues and pull requests on GitHub: #9203.
Significantly sped up filtering cookies -- by bdraco.
Related issues and pull requests on GitHub: #9204.
No significant changes. ----
No significant changes.
Removals and backward incompatible breaking changes
Increased minimum yarl version to 1.12.0 -- by :user:bdraco.
Related issues and pull requests on GitHub: #9267.
Removals and backward incompatible breaking changes
Implemented binding to IPv6 addresses in the pytest server fixture.
Related issues and pull requests on GitHub: #4650.
Fixed StreamResponse.prepared to return True after EOF is sent -- by arthurdarcet.
Related issues and pull requests on GitHub: #5343.
Fixed Response.text when body is a Payload -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #6485.
Added support for URL credentials with empty (zero-length) username, e.g. https://:password@host -- by shuckc
Related issues and pull requests on GitHub: #6494.
Fixed handling of some file-like objects (e.g. tarfile.extractfile()) which raise AttributeError instead of OSError when fileno fails for streaming payload data -- by ReallyReivax.
Related issues and pull requests on GitHub: #6732.
Stopped logging exceptions from web.run_app() that would be raised regardless -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #6807.
Changed make_mocked_request() to use empty payload by default -- by rahulnht.
Related issues and pull requests on GitHub: #7167.
Used more precise type for ClientResponseError.headers, fixing some type errors when using them -- by Dreamorcerer.
Related issues and pull requests on GitHub: #8768.
Fixed Python parser chunked handling with multiple Transfer-Encoding values -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8823.
Changed behavior when returning an invalid response to send a 500 response -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8845.
Stopped adding a default Content-Type header when response has no content -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8858.
Fixed an unclosed transport ResourceWarning on web handlers -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8875.
Fixed error handling after 100-continue so server sends 500 response instead of disconnecting -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8876.
Fixed response reading from closed session to throw an error immediately instead of timing out -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8878.
Fixed web router not matching pre-encoded URLs (requires yarl 1.9.6+) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8898.
Fixed CancelledError from one cleanup context stopping other contexts from completing -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8908.
Fixed Site.name when host is an empty string -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8929.
Fixed resolve_host() 'Task was destroyed but is pending' errors -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8967.
Fixed changing scheme/host in Response.clone() for absolute URLs -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8990.
Fixed client incorrectly reusing a connection when the previous message had not been fully sent -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8992.
Fixed an error when trying to add a route for multiple methods with a path containing a regex pattern -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8998.
Updated Python parser to reject messages after a close message, matching C parser behaviour -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9018.
Fixed creation of SSLContext inside of aiohttp.TCPConnector with multiple event loops in different threads -- by bdraco.
Related issues and pull requests on GitHub: #9029.
Fixed (on Python 3.11+) some edge cases where a task cancellation may get incorrectly suppressed -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9030.
Fixed the incorrect use of flags for getnameinfo() in the Resolver --by GitNMLee
Link-Local IPv6 addresses can now be handled by the Resolver correctly.
Related issues and pull requests on GitHub: #9032.
Fixed exception information getting lost on HttpProcessingError -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9052.
Fixed If-None-Match not using weak comparison -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9063.
Fixed compressed requests failing when no body was provided -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9108.
Added aiohttp.ClientConnectionResetError. Client code that previously threw ConnectionResetError will now throw this -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9137.
Fixed race condition that could cause server to close connection incorrectly at keepalive timeout -- by Dreamosorcerer.
Related issues and pull requests on GitHub: #9140.
Fixed badly encoded charset crashing when getting response text instead of falling back to charset detector.
Related issues and pull requests on GitHub: #9160.
Rejected n in reason values to avoid sending broken HTTP messages -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9167.
Changed ClientResponse.raise_for_status() to only release the connection when invoked outside an async with context -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9239.
Improved type on params to match the underlying type allowed by yarl -- by lpetre.
Related issues and pull requests on GitHub: #8564.
Improved middleware performance -- by bdraco.
The set_current_app method was removed from UrlMappingMatchInfo because it is no longer used, and it was unlikely external caller would ever use it.
Related issues and pull requests on GitHub: #9200.
Clarified that GracefulExit needs to be handled in AppRunner and ServerRunner when using handle_signals=True. -- by Daste745
Related issues and pull requests on GitHub: #4414.
Clarified that auth parameter in ClientSession will persist and be included with any request to any origin, even during redirects to different origins. -- by MaximZemskov.
Related issues and pull requests on GitHub: #6764.
Clarified which timeout exceptions happen on which timeouts -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8968.
Updated ClientSession parameters to match current code -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8991.
Fixed test_client_session_timeout_zero to not require internet access -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #9004.
Improved performance of making requests when there are no auto headers to skip -- by bdraco.
Related issues and pull requests on GitHub: #8847.
Exported aiohttp.TraceRequestHeadersSentParams -- by Hadock-is-ok.
Related issues and pull requests on GitHub: #8947.
Avoided tracing overhead in the http writer when there are no active traces -- by user:bdraco.
Related issues and pull requests on GitHub: #9031.
Improved performance of reify Cython implementation -- by bdraco.
Related issues and pull requests on GitHub: #9054.
Use URL.extend_query() to extend query params (requires yarl 1.11.0+) -- by bdraco.
If yarl is older than 1.11.0, the previous slower hand rolled version will be used.
Related issues and pull requests on GitHub: #9068.
Improved performance of checking if a host is an IP Address -- by bdraco.
Related issues and pull requests on GitHub: #9095.
Significantly improved performance of middlewares -- by bdraco.
The construction of the middleware wrappers is now cached and is built once per handler instead of on every request.
Related issues and pull requests on GitHub: #9158, #9170.
Improved performance of web requests -- by bdraco.
Related issues and pull requests on GitHub: #9168, #9169, #9172, #9174, #9175, #9241.
Improved performance of starting web requests when there is no response prepare hook -- by bdraco.
Related issues and pull requests on GitHub: #9173.
Significantly improved performance of expiring cookies -- by bdraco.
Expiring cookies has been redesigned to use heapq instead of a linear search, to better scale.
Related issues and pull requests on GitHub: #9203.
Significantly sped up filtering cookies -- by bdraco.
Related issues and pull requests on GitHub: #9204.
Fixed aiohttp.ClientResponse.json() not setting status when aiohttp.ContentTypeError is raised -- by bdraco.
Fixed aiohttp.ClientResponse.json() not setting status when aiohttp.ContentTypeError is raised -- by bdraco.
Related issues and pull requests on GitHub: #8742.
Improved performance of the WebSocket reader -- by bdraco.
Related issues and pull requests on GitHub: #8736, #8747.
Fixed decoding base64 chunk in BodyPartReader -- by hyzyla.
Fixed decoding base64 chunk in BodyPartReader -- by :user:hyzyla.
Related issues and pull requests on GitHub: #3867.
Fixed a race closing the server-side WebSocket where the close code would not reach the client -- by :user:bdraco.
Related issues and pull requests on GitHub: #8680.
Fixed unconsumed exceptions raised by the WebSocket heartbeat -- by :user:bdraco.
If the heartbeat ping raised an exception, it would not be consumed and would be logged as an warning.
Related issues and pull requests on GitHub: #8685.
Fixed an edge case in the Python parser when chunk separators happen to align with network chunks -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8720.
Added aiohttp-apischema to supported libraries -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8700.
Improved performance of starting request handlers with Python 3.12+ -- by :user:bdraco.
This change is a followup to #8661 to make the same optimization for Python 3.12+ where the request is connected.
Related issues and pull requests on GitHub: #8681.
Fixed multipart reading when stream buffer splits the boundary over several read() calls -- by Dreamsorcerer.
Fixed multipart reading when stream buffer splits the boundary over several read() calls -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8653.
Fixed aiohttp.TCPConnector doing blocking I/O in the event loop to create the SSLContext -- by bdraco.
The blocking I/O would only happen once per verify mode. However, it could cause the event loop to block for a long time if the SSLContext creation is slow, which is more likely during startup when the disk cache is not yet present.
Related issues and pull requests on GitHub: #8672.
Improved performance of ~aiohttp.ClientWebSocketResponse.receive and ~aiohttp.web.WebSocketResponse.receive when there is no timeout. -- by bdraco.
The timeout context manager is now avoided when there is no timeout as it accounted for up to 50% of the time spent in the ~aiohttp.ClientWebSocketResponse.receive and ~aiohttp.web.WebSocketResponse.receive methods.
Related issues and pull requests on GitHub: #8660.
Improved performance of starting request handlers with Python 3.12+ -- by bdraco.
Related issues and pull requests on GitHub: #8661.
Improved performance of HTTP keep-alive checks -- by bdraco.
Previously, when processing a request for a keep-alive connection, the keep-alive check would happen every second; the check is now rescheduled if it fires too early instead.
Related issues and pull requests on GitHub: #8662.
Improved performance of generating random WebSocket mask -- by bdraco.
Related issues and pull requests on GitHub: #8667.
Removals and backward incompatible breaking changes
Fixed server checks for circular symbolic links to be compatible with Python 3.13 -- by :user:steverep.
Related issues and pull requests on GitHub: #8565.
Fixed request body not being read when ignoring an Upgrade request -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8597.
Fixed an edge case where shutdown would wait for timeout when the handler was already completed -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8611.
Fixed connecting to npipe://, tcp://, and unix:// urls -- by :user:bdraco.
Related issues and pull requests on GitHub: #8632.
Fixed WebSocket ping tasks being prematurely garbage collected -- by :user:bdraco.
There was a small risk that WebSocket ping tasks would be prematurely garbage collected because the event loop only holds a weak reference to the task. The garbage collection risk has been fixed by holding a strong reference to the task. Additionally, the task is now scheduled eagerly with Python 3.12+ to increase the chance it can be completed immediately and avoid having to hold any references to the task.
Related issues and pull requests on GitHub: #8641.
Fixed incorrectly following symlinks for compressed file variants -- by :user:steverep.
Related issues and pull requests on GitHub: #8652.
Removed Request.wait_for_disconnection(), which was mistakenly added briefly in 3.10.0 -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8636.
Fixed monkey patches for Path.stat() and Path.is_dir() for Python 3.13 compatibility -- by :user:steverep.
Related issues and pull requests on GitHub: #8551.
Improved WebSocket performance when messages are sent or received frequently -- by :user:bdraco.
The WebSocket heartbeat scheduling algorithm was improved to reduce the asyncio scheduling overhead by decreasing the number of asyncio.TimerHandle creations and cancellations.
Related issues and pull requests on GitHub: #8608.
Minor improvements to various type annotations -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8634.
Removals and backward incompatible breaking changes
Fixed WebSocket server heartbeat timeout logic to terminate ~aiohttp.ClientWebSocketResponse.receive and return ~aiohttp.ServerTimeoutError -- by arcivanov.
When a WebSocket pong message was not received, the ~aiohttp.ClientWebSocketResponse.receive operation did not terminate. This change causes _pong_not_received to feed the reader an error message, causing pending ~aiohttp.ClientWebSocketResponse.receive to terminate and return the error message. The error message contains the exception ~aiohttp.ServerTimeoutError.
Related issues and pull requests on GitHub: #8540.
Fixed url dispatcher index not matching when a variable is preceded by a fixed string after a slash -- by bdraco.
Related issues and pull requests on GitHub: #8566.
Creating aiohttp.TCPConnector, aiohttp.ClientSession, ~aiohttp.resolver.ThreadedResolver aiohttp.web.Server, or aiohttp.CookieJar instances without a running event loop now raises a RuntimeError -- by asvetlov.
Creating these objects without a running event loop was deprecated in #3372 which was released in version 3.5.0.
This change first appeared in version 3.10.0 as #6378.
Related issues and pull requests on GitHub: #8555, #8583.
Removals and backward incompatible breaking changes
Fixed server response headers for Content-Type and Content-Encoding for static compressed files -- by steverep.
Server will now respond with a Content-Type appropriate for the compressed file (e.g. "application/gzip"), and omit the Content-Encoding header. Users should expect that most clients will no longer decompress such responses by default.
Related issues and pull requests on GitHub: #4462.
Fixed duplicate cookie expiration calls in the CookieJar implementation
Related issues and pull requests on GitHub: #7784.
Adjusted FileResponse to check file existence and access when preparing the response -- by steverep.
403 Forbidden or 404 Not Found as appropriate. Previously, it would cause a server error if the path did not exist or could not be accessed. Checks for existence, non-regular files, and permissions were expected to be done in the route handler. For static routes, this now permits a compressed file to exist without its uncompressed variant and still be served. In addition, this changes the response status for files without read permission to 403, and for non-regular files from 404 to 403 for consistency.
Related issues and pull requests on GitHub: #8182.
Fixed AsyncResolver to match ThreadedResolver behavior -- by bdraco.
On system with IPv6 support, the ~aiohttp.resolver.AsyncResolver would not fallback to providing A records when AAAA records were not available. Additionally, unlike the ~aiohttp.resolver.ThreadedResolver, the ~aiohttp.resolver.AsyncResolver did not handle link-local addresses correctly.
This change makes the behavior consistent with the ~aiohttp.resolver.ThreadedResolver.
Related issues and pull requests on GitHub: #8270.
Fixed ws_connect not respecting receive_timeout` on WS(S) connection. -- by arcivanov.
Related issues and pull requests on GitHub: #8444.
Removed blocking I/O in the event loop for static resources and refactored exception handling -- by steverep.
File system calls when handling requests for static routes were moved to a separate thread to potentially improve performance. Exception handling was tightened in order to only return 403 Forbidden or 404 Not Found responses for expected scenarios; 500 Internal Server Error would be returned for any unknown errors.
Related issues and pull requests on GitHub: #8507.
Added a Request.wait_for_disconnection() method, as means of allowing request handlers to be notified of premature client disconnections.
Related issues and pull requests on GitHub: #2492.
Added 5 new exceptions: ~aiohttp.InvalidUrlClientError, ~aiohttp.RedirectClientError, ~aiohttp.NonHttpUrlClientError, ~aiohttp.InvalidUrlRedirectClientError, ~aiohttp.NonHttpUrlRedirectClientError
~aiohttp.InvalidUrlRedirectClientError, ~aiohttp.NonHttpUrlRedirectClientError are raised instead of ValueError or ~aiohttp.InvalidURL when the redirect URL is invalid. Classes ~aiohttp.InvalidUrlClientError, ~aiohttp.RedirectClientError, ~aiohttp.NonHttpUrlClientError are base for them.
The ~aiohttp.InvalidURL now exposes a description property with the text explanation of the error details.
-- by setla, AraHaan, and bdraco
Related issues and pull requests on GitHub: #2507, #3315, #6722, #8481, #8482.
Added a feature to retry closed connections automatically for idempotent methods. -- by Dreamsorcerer
Related issues and pull requests on GitHub: #7297.
Implemented filter_cookies() with domain-matching and path-matching on the keys, instead of testing every single cookie. This may break existing cookies that have been saved with CookieJar.save(). Cookies can be migrated with this script:
import pickle
with file_path.open("rb") as f:
cookies = pickle.load(f)
morsels = [(name, m) for c in cookies.values() for name, m in c.items()]
cookies.clear()
for name, m in morsels:
cookies[(m["domain"], m["path"].rstrip("/"))][name] = m
with file_path.open("wb") as f:
pickle.dump(cookies, f, pickle.HIGHEST_PROTOCOL)
Related issues and pull requests on GitHub: #7583, #8535.
Separated connection and socket timeout errors, from ServerTimeoutError.
Related issues and pull requests on GitHub: #7801.
Implemented happy eyeballs
Related issues and pull requests on GitHub: #7954.
Added server capability to check for static files with Brotli compression via a .br extension -- by steverep.
Related issues and pull requests on GitHub: #8062.
The shutdown logic in 3.9 waited on all tasks, which caused issues with some libraries. In 3.10 we've changed this logic to only wait on request handlers. This means that it's important for developers to correctly handle the lifecycle of background tasks using a library such as aiojobs. If an application is using handler_cancellation=True then it is also a good idea to ensure that any asyncio.shield calls are replaced with aiojobs.aiohttp.shield.
Please read the updated documentation on these points: https://docs.aiohttp.org/en/stable/web_advanced.html#graceful-shutdown https://docs.aiohttp.org/en/stable/web_advanced.html#web-handler-cancellation
-- by Dreamsorcerer
Related issues and pull requests on GitHub: #8495.
Added documentation for aiohttp.web.FileResponse.
Related issues and pull requests on GitHub: #3958.
Improved the docs for the ssl params.
Related issues and pull requests on GitHub: #8403.
Enabled HTTP parser tests originally intended for 3.9.2 release -- by pajod.
Related issues and pull requests on GitHub: #8088.
Improved URL handler resolution time by indexing resources in the UrlDispatcher. For applications with a large number of handlers, this should increase performance significantly. -- by bdraco
Related issues and pull requests on GitHub: #7829.
Added nacl_middleware to the list of middlewares in the third party section of the documentation.
Related issues and pull requests on GitHub: #8346.
Minor improvements to static typing -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8364.
Added a 3.11-specific overloads to ClientSession -- by max-muoto.
Related issues and pull requests on GitHub: #8463.
Simplified path checks for UrlDispatcher.add_static() method -- by steverep.
Related issues and pull requests on GitHub: #8491.
Avoided creating a future on every websocket receive -- by bdraco.
Related issues and pull requests on GitHub: #8498.
Updated identity checks for all WSMsgType type compares -- by bdraco.
Related issues and pull requests on GitHub: #8501.
When using Python 3.12 or later, the writer is no longer scheduled on the event loop if it can finish synchronously. Avoiding event loop scheduling reduces latency and improves performance. -- by bdraco.
Related issues and pull requests on GitHub: #8510.
Restored ~aiohttp.resolver.AsyncResolver to be the default resolver. -- by bdraco.
~aiohttp.resolver.AsyncResolver was disabled by default because of IPv6 compatibility issues. These issues have been resolved and ~aiohttp.resolver.AsyncResolver is again now the default resolver.
Related issues and pull requests on GitHub: #8522.
Removals and backward incompatible breaking changes
Adjusted FileResponse to check file existence and access when preparing the response -- by steverep.
403 Forbidden or 404 Not Found as appropriate. Previously, it would cause a server error if the path did not exist or could not be accessed. Checks for existence, non-regular files, and permissions were expected to be done in the route handler. For static routes, this now permits a compressed file to exist without its uncompressed variant and still be served. In addition, this changes the response status for files without read permission to 403, and for non-regular files from 404 to 403 for consistency.
Related issues and pull requests on GitHub: #8182.
The shutdown logic in 3.9 waited on all tasks, which caused issues with some libraries. In 3.10 we've changed this logic to only wait on request handlers. This means that it's important for developers to correctly handle the lifecycle of background tasks using a library such as aiojobs. If an application is using handler_cancellation=True then it is also a good idea to ensure that any asyncio.shield calls are replaced with aiojobs.aiohttp.shield.
Please read the updated documentation on these points: https://docs.aiohttp.org/en/stable/web_advanced.html#graceful-shutdown https://docs.aiohttp.org/en/stable/web_advanced.html#web-handler-cancellation
-- by Dreamsorcerer
Related issues and pull requests on GitHub: #8495.
Improve performance of filtering cookies -- by bdraco.
This change is a followup to the improvements in #7583
Related issues and pull requests on GitHub: #8535.
Fixed server response headers for Content-Type and Content-Encoding for static compressed files -- by steverep.
Fixed server response headers for Content-Type and Content-Encoding for static compressed files -- by steverep.
Server will now respond with a Content-Type appropriate for the compressed file (e.g. "application/gzip"), and omit the Content-Encoding header. Users should expect that most clients will no longer decompress such responses by default.
Related issues and pull requests on GitHub: #4462.
Fix duplicate cookie expiration calls in the CookieJar implementation
Related issues and pull requests on GitHub: #7784.
Fix AsyncResolver to match ThreadedResolver behavior -- by bdraco.
On system with IPv6 support, the ~aiohttp.resolver.AsyncResolver would not fallback to providing A records when AAAA records were not available. Additionally, unlike the ~aiohttp.resolver.ThreadedResolver, the ~aiohttp.resolver.AsyncResolver did not handle link-local addresses correctly.
This change makes the behavior consistent with the ~aiohttp.resolver.ThreadedResolver.
Related issues and pull requests on GitHub: #8270.
Fix ws_connect not respecting receive_timeout` on WS(S) connection. -- by arcivanov.
Related issues and pull requests on GitHub: #8444.
Removed blocking I/O in the event loop for static resources and refactored exception handling -- by steverep.
File system calls when handling requests for static routes were moved to a separate thread to potentially improve performance. Exception handling was tightened in order to only return 403 Forbidden or 404 Not Found responses for expected scenarios; 500 Internal Server Error would be returned for any unknown errors.
Related issues and pull requests on GitHub: #8507.
Add a Request.wait_for_disconnection() method, as means of allowing request handlers to be notified of premature client disconnections.
Related issues and pull requests on GitHub: #2492.
Added 5 new exceptions: ~aiohttp.InvalidUrlClientError, ~aiohttp.RedirectClientError, ~aiohttp.NonHttpUrlClientError, ~aiohttp.InvalidUrlRedirectClientError, ~aiohttp.NonHttpUrlRedirectClientError
~aiohttp.InvalidUrlRedirectClientError, ~aiohttp.NonHttpUrlRedirectClientError are raised instead of ValueError or ~aiohttp.InvalidURL when the redirect URL is invalid. Classes ~aiohttp.InvalidUrlClientError, ~aiohttp.RedirectClientError, ~aiohttp.NonHttpUrlClientError are base for them.
The ~aiohttp.InvalidURL now exposes a description property with the text explanation of the error details.
-- by setla, AraHaan, and bdraco
Related issues and pull requests on GitHub: #2507, #3315, #6722, #8481, #8482.
Added a feature to retry closed connections automatically for idempotent methods. -- by Dreamsorcerer
Related issues and pull requests on GitHub: #7297.
Implement filter_cookies() with domain-matching and path-matching on the keys, instead of testing every single cookie. This may break existing cookies that have been saved with CookieJar.save(). Cookies can be migrated with this script:
import pickle
with file_path.open("rb") as f:
cookies = pickle.load(f)
morsels = [(name, m) for c in cookies.values() for name, m in c.items()]
cookies.clear()
for name, m in morsels:
cookies[(m["domain"], m["path"].rstrip("/"))][name] = m
with file_path.open("wb") as f:
pickle.dump(cookies, f, pickle.HIGHEST_PROTOCOL)
Related issues and pull requests on GitHub: #7583.
Separated connection and socket timeout errors, from ServerTimeoutError.
Related issues and pull requests on GitHub: #7801.
Implement happy eyeballs
Related issues and pull requests on GitHub: #7954.
Added server capability to check for static files with Brotli compression via a .br extension -- by steverep.
Related issues and pull requests on GitHub: #8062.
Add documentation for aiohttp.web.FileResponse.
Related issues and pull requests on GitHub: #3958.
Improve the docs for the ssl params.
Related issues and pull requests on GitHub: #8403.
Enabled HTTP parser tests originally intended for 3.9.2 release -- by pajod.
Related issues and pull requests on GitHub: #8088.
Improved URL handler resolution time by indexing resources in the UrlDispatcher. For applications with a large number of handlers, this should increase performance significantly. -- by bdraco
Related issues and pull requests on GitHub: #7829.
Add nacl_middleware to the list of middlewares in the third party section of the documentation.
Related issues and pull requests on GitHub: #8346.
Minor improvements to static typing -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8364.
Added a 3.11-specific overloads to ClientSession -- by max-muoto.
Related issues and pull requests on GitHub: #8463.
Simplified path checks for UrlDispatcher.add_static() method -- by steverep.
Related issues and pull requests on GitHub: #8491.
Avoid creating a future on every websocket receive -- by bdraco.
Related issues and pull requests on GitHub: #8498.
Use identity checks for all WSMsgType type compares -- by bdraco.
Related issues and pull requests on GitHub: #8501.
When using Python 3.12 or later, the writer is no longer scheduled on the event loop if it can finish synchronously. Avoiding event loop scheduling reduces latency and improves performance. -- by bdraco.
Related issues and pull requests on GitHub: #8510.
Restore ~aiohttp.resolver.AsyncResolver to be the default resolver. -- by bdraco.
~aiohttp.resolver.AsyncResolver was disabled by default because of IPv6 compatibility issues. These issues have been resolved and ~aiohttp.resolver.AsyncResolver is again now the default resolver.
Related issues and pull requests on GitHub: #8522.
Fixed "Unclosed client session" when initialization of class:~aiohttp.ClientSession fails -- by NewGlad.
Fixed "Unclosed client session" when initialization of ~aiohttp.ClientSession fails -- by NewGlad.
Related issues and pull requests on GitHub: #8253.
Fixed regression (from 8280) with adding Content-Disposition to the form-data part after appending to writer -- by Dreamsorcerer/Olegt0rr.
Related issues and pull requests on GitHub: #8332.
Added default Content-Disposition in multipart/form-data responses to avoid broken form-data responses -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8335.
Deprecations (removal in next major release)
The asynchronous internals now set the underlying causes when assigning exceptions to the future objects -- by webknjaz.
Related issues and pull requests on GitHub: #8089.
Treated values of Accept-Encoding header as case-insensitive when checking for gzip files -- by steverep.
Related issues and pull requests on GitHub: #8104.
Improved the DNS resolution performance on cache hit -- by bdraco.
This is achieved by avoiding an asyncio task creation in this case.
Related issues and pull requests on GitHub: #8163.
Changed the type annotations to allow dict on aiohttp.MultipartWriter.append, aiohttp.MultipartWriter.append_json and aiohttp.MultipartWriter.append_form -- by cakemanny
Related issues and pull requests on GitHub: #7741.
Ensure websocket transport is closed when client does not close it -- by bdraco.
The transport could remain open if the client did not close it. This change ensures the transport is closed when the client does not close it.
Related issues and pull requests on GitHub: #8200.
Leave websocket transport open if receive times out or is cancelled -- by bdraco.
This restores the behavior prior to the change in #7978.
Related issues and pull requests on GitHub: #8251.
Fixed content not being read when an upgrade request was not supported with the pure Python implementation. -- by bdraco.
Related issues and pull requests on GitHub: #8252.
Fixed a race condition with incoming connections during server shutdown -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8271.
Fixed multipart/form-data compliance with 7578 -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8280.
Fixed blocking I/O in the event loop while processing files in a POST request -- by bdraco.
Related issues and pull requests on GitHub: #8283.
Escaped filenames in static view -- by bdraco.
Related issues and pull requests on GitHub: #8317.
Fixed the pure python parser to mark a connection as closing when a response has no length -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8320.
Upgraded llhttp to 9.2.1, and started rejecting obsolete line folding in Python parser to match -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8146, #8292.
Deprecated content_transfer_encoding parameter in FormData.add_field() -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8280.
Added a note about canceling tasks to avoid delaying server shutdown -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8267.
The pull request template is now asking the contributors to answer a question about the long-term maintenance challenges they envision as a result of merging their patches -- by webknjaz.
Related issues and pull requests on GitHub: #8099.
Updated CI and documentation to use NPM clean install and upgrade node to version 18 -- by steverep.
Related issues and pull requests on GitHub: #8116.
A pytest fixture hello_txt was introduced to aid static file serving tests in test_web_sendfile_functional.py. It dynamically provisions hello.txt file variants shared across the tests in the module.
-- by steverep
Related issues and pull requests on GitHub: #8136.
Added an internal pytest marker for tests which should be skipped by packagers (use -m 'not internal' to disable them) -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #8299.
The asynchronous internals now set the underlying causes when assigning exceptions to the future objects -- by webknjaz.
The asynchronous internals now set the underlying causes
when assigning exceptions to the future objects
-- by :user:webknjaz.
Related issues and pull requests on GitHub: #8089.
Treated values of Accept-Encoding header as case-insensitive when checking for gzip files -- by :user:steverep.
Related issues and pull requests on GitHub: #8104.
Upgraded llhttp to 9.2 -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8146.
The pull request template is now asking the contributors to
answer a question about the long-term maintenance challenges
they envision as a result of merging their patches
-- by :user:webknjaz.
Related issues and pull requests on GitHub: #8099.
Updated CI and documentation to use NPM clean install and upgrade node to version 18 -- by :user:steverep.
Related issues and pull requests on GitHub: #8116.
A pytest fixture hello_txt was introduced to aid
static file serving tests in
:file:test_web_sendfile_functional.py. It dynamically
provisions hello.txt file variants shared across the
tests in the module.
-- by :user:steverep
Related issues and pull requests on GitHub: #8136.
Two definitions for "test_invalid_route_name" existed, only one was being run. Refactored them into a single parameterized test. Enabled lint rule to prevent regression. -- by :user:alexmac.
Related issues and pull requests on GitHub: #8139.
Fixed backwards compatibility breakage (in 3.9.2) of ssl parameter when set outside of ClientSession (e.g. directly in TCPConnector) -- by Dreamsorcer
Fixed backwards compatibility breakage (in 3.9.2) of ssl parameter when set outside
of ClientSession (e.g. directly in TCPConnector) -- by :user:Dreamsorcerer.
Related issues and pull requests on GitHub: #8097, #8098.
Improved test suite handling of paths and temp files to consistently use pathlib and pytest fixtures.
Related issues and pull requests on GitHub: #3957.
Added support for passing data:True to ssl parameter in ClientSession while deprecating data:None -- by xiangyan99.
Fixed server-side websocket connection leak.
Related issues and pull requests on GitHub: #7978.
Fixed web.FileResponse doing blocking I/O in the event loop.
Related issues and pull requests on GitHub: #8012.
Fixed double compress when compression enabled and compressed file exists in server file responses.
Related issues and pull requests on GitHub: #8014.
Added runtime type check for ClientSession timeout parameter.
Related issues and pull requests on GitHub: #8021.
Fixed an unhandled exception in the Python HTTP parser on header lines starting with a colon -- by pajod.
Invalid request lines with anything but a dot between the HTTP major and minor version are now rejected. Invalid header field names containing question mark or slash are now rejected. Such requests are incompatible with 9110#section-5.6.2 and are not known to be of any legitimate use.
Related issues and pull requests on GitHub: #8074.
Improved validation of paths for static resources requests to the server -- by bdraco.
Related issues and pull requests on GitHub: #8079.
Added support for passing True to ssl parameter in ClientSession while deprecating None -- by xiangyan99.
Related issues and pull requests on GitHub: #7698.
Fixed an unhandled exception in the Python HTTP parser on header lines starting with a colon -- by pajod.
Invalid request lines with anything but a dot between the HTTP major and minor version are now rejected. Invalid header field names containing question mark or slash are now rejected. Such requests are incompatible with 9110#section-5.6.2 and are not known to be of any legitimate use.
Related issues and pull requests on GitHub: #8074.
Fixed examples of fallback_charset_resolver function in the client_advanced document. -- by henry0312.
Related issues and pull requests on GitHub: #7995.
The Sphinx setup was updated to avoid showing the empty changelog draft section in the tagged release documentation builds on Read The Docs -- by webknjaz.
Related issues and pull requests on GitHub: #8067.
The changelog categorization was made clearer. The contributors can now mark their fragment files more accurately -- by webknjaz.
The new category tags are:
bugfix
feature
deprecation
breaking (previously, removal)
doc
packaging
contrib
misc
Related issues and pull requests on GitHub: #8066.
Updated contributing/Tests coverage section to show how we use codecov -- by Dreamsorcerer.
Related issues and pull requests on GitHub: #7916.
The changelog categorization was made clearer. The contributors can now mark their fragment files more accurately -- by webknjaz.
The new category tags are:
bugfix
feature
deprecation
breaking (previously, removal)
doc
packaging
contrib
misc
Related issues and pull requests on GitHub: #8066.
Replaced all tmpdir fixtures with tmp_path in test suite.
Related issues and pull requests on GitHub: #3551.
Fixed importing aiohttp under PyPy on Windows.
Fixed importing aiohttp under PyPy on Windows.
(#7848)
Fixed async concurrency safety in websocket compressor.
(#7865)
Fixed ClientResponse.close() releasing the connection instead of closing.
(#7869)
Fixed a regression where connection may get closed during upgrade. -- by :user:Dreamsorcerer
(#7879)
Fixed messages being reported as upgraded without an Upgrade header in Python parser. -- by :user:Dreamsorcerer
(#7895)
Changed max 32-bit timestamp to an aware datetime object, for consistency with the non-32-bit one, and to avoid a DeprecationWarning on Python 3.12.
Introduced AppKey for static typing support of Application storage. See https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
(#5864)
Added a graceful shutdown period which allows pending tasks to complete before the application's cleanup is called. The period can be adjusted with the shutdown_timeout parameter. -- by Dreamsorcerer. See https://docs.aiohttp.org/en/latest/web_advanced.html#graceful-shutdown
(#7188)
Added handler_cancellation parameter to cancel web handler on client disconnection. -- by mosquito This (optionally) reintroduces a feature removed in a previous release. Recommended for those looking for an extra level of protection against denial-of-service attacks.
(#7056)
Added support for setting response header parameters max_line_size and max_field_size.
(#2304)
Added auto_decompress parameter to ClientSession.request to override ClientSession._auto_decompress. -- by Daste745
(#3751)
Changed raise_for_status to allow a coroutine.
(#3892)
Added client brotli compression support (optional with runtime check).
(#5219)
Added client_max_size to BaseRequest.clone() to allow overriding the request body size. -- anesabml.
(#5704)
Added a middleware type alias aiohttp.typedefs.Middleware.
(#5898)
Exported HTTPMove which can be used to catch any redirection request that has a location -- dreamsorcerer.
(#6594)
Changed the path parameter in web.run_app() to accept a pathlib.Path object.
(#6839)
Performance: Skipped filtering CookieJar when the jar is empty or all cookies have expired.
(#7819)
Performance: Only check origin if insecure scheme and there are origins to treat as secure, in CookieJar.filter_cookies().
(#7821)
Performance: Used timestamp instead of datetime to achieve faster cookie expiration in CookieJar.
(#7824)
Added support for passing a custom server name parameter to HTTPS connection.
(#7114)
Added support for using Basic Auth credentials from .netrc file when making HTTP requests with the ~aiohttp.ClientSession trust_env argument is set to True. -- by yuvipanda.
(#7131)
Turned access log into no-op when the logger is disabled.
(#7240)
Added typing information to RawResponseMessage. -- by Gobot1234
(#7365)
Removed async-timeout for Python 3.11+ (replaced with asyncio.timeout() on newer releases).
(#7502)
Added support for brotlicffi as an alternative to brotli (fixing Brotli support on PyPy).
(#7611)
Added WebSocketResponse.get_extra_info() to access a protocol transport's extra info.
(#7078)
Allow link argument to be set to None/empty in HTTP 451 exception.
(#7689)
Implemented stripping the trailing dots from fully-qualified domain names in Host headers and TLS context when acting as an HTTP client. This allows the client to connect to URLs with FQDN host name like https://example.com./. -- by martin-sucha.
(#3636)
Fixed client timeout not working when incoming data is always available without waiting. -- by Dreamsorcerer.
(#5854)
Fixed readuntil to work with a delimiter of more than one character.
(#6701)
Added __repr__ to EmptyStreamReader to avoid AttributeError.
(#6916)
Fixed bug when using TCPConnector with ttl_dns_cache=0.
(#7014)
Fixed response returned from expect handler being thrown away. -- by Dreamsorcerer
(#7025)
Avoided raising UnicodeDecodeError in multipart and in HTTP headers parsing.
(#7044)
Changed sock_read timeout to start after writing has finished, avoiding read timeouts caused by an unfinished write. -- by dtrifiro
(#7149)
Fixed missing query in tracing method URLs when using yarl 1.9+.
(#7259)
Changed max 32-bit timestamp to an aware datetime object, for consistency with the non-32-bit one, and to avoid a DeprecationWarning on Python 3.12.
(#7302)
Fixed EmptyStreamReader.iter_chunks() never ending. -- by mind1m
(#7616)
Fixed a rare RuntimeError: await wasn't used with future exception. -- by stalkerg
(#7785)
Fixed issue with insufficient HTTP method and version validation.
(#7700)
Added check to validate that absolute URIs have schemes.
(#7712)
Fixed unhandled exception when Python HTTP parser encounters unpaired Unicode surrogates.
(#7715)
Updated parser to disallow invalid characters in header field names and stop accepting LF as a request line separator.
(#7719)
Fixed Python HTTP parser not treating 204/304/1xx as an empty body.
(#7755)
Ensure empty body response for 1xx/204/304 per RFC 9112 sec 6.3.
(#7756)
Fixed an issue when a client request is closed before completing a chunked payload. -- by Dreamsorcerer
(#7764)
Edge Case Handling for ResponseParser for missing reason value.
(#7776)
Fixed ClientWebSocketResponse.close_code being erroneously set to None when there are concurrent async tasks receiving data and closing the connection.
(#7306)
Added HTTP method validation.
(#6533)
Fixed arbitrary sequence types being allowed to inject values via version parameter. -- by Dreamsorcerer
(#7835)
Performance: Fixed increase in latency with small messages from websocket compression changes.
(#7797)
Fixed the ClientResponse.release's type in the doc. Changed from comethod to method.
(#5836)
Added information on behavior of base_url parameter in ClientSession.
(#6647)
Fixed ClientResponseError docs.
(#6700)
Updated Redis code examples to follow the latest API.
(#6907)
Added a note about possibly needing to update headers when using on_response_prepare. -- by Dreamsorcerer
(#7283)
Completed trust_env parameter description to honor wss_proxy, ws_proxy or no_proxy env.
(#7325)
Expanded SSL documentation with more examples (e.g. how to use certifi). -- by Dreamsorcerer
(#7334)
Fix, update, and improve client exceptions documentation.
(#7733)
Added shutdown_timeout parameter to BaseRunner, while deprecating shutdown_timeout parameter from BaseSite. -- by Dreamsorcerer
(#7718)
Dropped Python 3.6 support.
(#6378)
Dropped Python 3.7 support. -- by Dreamsorcerer
(#7336)
Removed support for abandoned tokio event loop. -- by Dreamsorcerer
(#7281)
Made print argument in run_app() optional.
(#3690)
Improved performance of ceil_timeout in some cases.
(#6316)
Changed importing Gunicorn to happen on-demand, decreasing import time by ~53%. -- Dreamsorcerer
(#6591)
Improved import time by replacing http.server with http.HTTPStatus.
(#6903)
Fixed annotation of ssl parameter to disallow True. -- by Dreamsorcerer.
(#7335)
Performance: Skipped filtering CookieJar when the jar is empty or all cookies have expired.
Performance: Skipped filtering CookieJar when the jar is empty or all cookies have expired.
(#7819)
Performance: Only check origin if insecure scheme and there are origins to treat as secure, in CookieJar.filter_cookies().
(#7821)
Performance: Used timestamp instead of datetime to achieve faster cookie expiration in CookieJar.
(#7824)
Fixed an issue where the client could go into an infinite loop. -- by :user:Dreamsorcerer
(#7815)
Added HTTP method validation.
(#6533)
Fixed arbitrary sequence types being allowed to inject values via version parameter. -- by :user:Dreamsorcerer
(#7835)
Performance: Fixed increase in latency with small messages from websocket compression changes.
(#7797)
Added shutdown_timeout parameter to BaseRunner, while deprecating shutdown_timeout parameter from BaseSite. -- by Dreamsorcerer
Added WebSocketResponse.get_extra_info() to access a protocol transport's extra info.
(#7078)
Allow link argument to be set to None/empty in HTTP 451 exception.
(#7689)
Added shutdown_timeout parameter to BaseRunner, while
deprecating shutdown_timeout parameter from BaseSite. -- by :user:Dreamsorcerer
(#7718)
Fixed keep-alive connections stopping a graceful shutdown. -- by :user:Dreamsorcerer
(#7718)
Fixed ClientWebSocketResponse.close_code being erroneously set to None when there are concurrent async tasks receiving data and closing the connection.
(#7306)
Changed AppKey warning to web.NotAppKeyWarning and stop it being displayed by default. -- by :user:Dreamsorcerer
(#7677)
Fix issue with insufficient HTTP method and version validation.
(#7700)
Add check to validate that absolute URIs have schemes.
(#7712)
Fix unhandled exception when Python HTTP parser encounters unpaired Unicode surrogates.
(#7715)
Update parser to disallow invalid characters in header field names and stop accepting LF as a request line separator.
(#7719)
Fix py http parser not treating 204/304/1xx as an empty body
(#7755)
Ensure empty body response for 1xx/204/304 per RFC 9112 sec 6.3
(#7756)
Fixed an issue when a client request is closed before completing a chunked payload -- by :user:Dreamsorcerer
(#7764)
Edge Case Handling for ResponseParser for missing reason value
(#7776)
Fixed a rare RuntimeError: await wasn't used with future exception -- by :user:stalkerg
(#7785)
Fix, update, and improve client exceptions documentation.
(#7733)
Changed max 32-bit timestamp to an aware datetime object, for consistency with the non-32-bit one, and to avoid a DeprecationWarning on Python 3.12.
Introduced AppKey for static typing support of Application storage. See https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
(#5864)
Added a graceful shutdown period which allows pending tasks to complete before the application's cleanup is called. The period can be adjusted with the shutdown_timeout parameter. -- by Dreamsorcerer. See https://docs.aiohttp.org/en/latest/web_advanced.html#graceful-shutdown
(#7188)
Added handler_cancellation parameter to cancel web handler on client disconnection. -- by mosquito This (optionally) reintroduces a feature removed in a previous release. Recommended for those looking for an extra level of protection against denial-of-service attacks.
(#7056)
Added support for setting response header parameters max_line_size and max_field_size.
(#2304)
Added auto_decompress parameter to ClientSession.request to override ClientSession._auto_decompress. -- by Daste745
(#3751)
Changed raise_for_status to allow a coroutine.
(#3892)
Added client brotli compression support (optional with runtime check).
(#5219)
Added client_max_size to BaseRequest.clone() to allow overriding the request body size -- anesabml.
(#5704)
Added a middleware type alias aiohttp.typedefs.Middleware.
(#5898)
Exported HTTPMove which can be used to catch any redirection request that has a location -- dreamsorcerer.
(#6594)
Changed the path parameter in web.run_app() to accept a pathlib.Path object.
(#6839)
Added support for passing a custom server name parameter to HTTPS connection.
(#7114)
Added support for using Basic Auth credentials from .netrc file when making HTTP requests with the ~aiohttp.ClientSession trust_env argument is set to True -- by yuvipanda.
(#7131)
Turned access log into no-op when the logger is disabled.
(#7240)
Added typing information to RawResponseMessage -- by Gobot1234
(#7365)
Removed async-timeout for Python 3.11+ (replaced with asyncio.timeout() on newer releases).
(#7502)
Added support for brotlicffi as an alternative to brotli (fixing Brotli support on PyPy).
(#7611)
Implemented stripping the trailing dots from fully-qualified domain names in Host headers and TLS context when acting as an HTTP client. This allows the client to connect to URLs with FQDN host name like https://example.com./. -- by martin-sucha.
(#3636)
Fixed client timeout not working when incoming data is always available without waiting -- by Dreamsorcerer.
(#5854)
Fixed readuntil to work with a delimiter of more than one character
(#6701)
Added __repr__ to EmptyStreamReader to avoid AttributeError.
(#6916)
Fixed bug when using TCPConnector with ttl_dns_cache=0.
(#7014)
Fixed response returned from expect handler being thrown away. -- by Dreamsorcerer
(#7025)
Avoided raising UnicodeDecodeError in multipart and in HTTP headers parsing.
(#7044)
Changed sock_read timeout to start after writing has finished, avoiding read timeouts caused by an unfinished write. -- by dtrifiro
(#7149)
Fixed missing query in tracing method URLs when using yarl 1.9+.
(#7259)
Changed max 32-bit timestamp to an aware datetime object, for consistency with the non-32-bit one, and to avoid a DeprecationWarning on Python 3.12.
(#7302)
Fixed EmptyStreamReader.iter_chunks() never ending. -- by mind1m
(#7616)
Fixed the ClientResponse.release's type in the doc. Changed from comethod to method.
(#5836)
Added information on behavior of base_url parameter in ClientSession.
(#6647)
Fixed ClientResponseError docs.
(#6700)
Updated Redis code examples to follow the latest API.
(#6907)
Added a note about possibly needing to update headers when using on_response_prepare. -- by Dreamsorcerer
(#7283)
Completed trust_env parameter description to honor wss_proxy, ws_proxy or no_proxy env.
(#7325)
Expanded SSL documentation with more examples (e.g. how to use certifi). -- by Dreamsorcerer
(#7334)
Dropped Python 3.6 support.
(#6378)
Dropped Python 3.7 support. -- by Dreamsorcerer
(#7336)
Removed support for abandoned tokio event loop. -- by Dreamsorcerer
(#7281)
Made print argument in run_app() optional.
(#3690)
Improved performance of ceil_timeout in some cases.
(#6316)
Changed importing Gunicorn to happen on-demand, decreasing import time by ~53%. -- Dreamsorcerer
(#6591)
Improved import time by replacing http.server with http.HTTPStatus.
(#6903)
Fixed annotation of ssl parameter to disallow True. -- by Dreamsorcerer
(#7335)
Upgraded the vendored copy of llhttp_ to v9.1.3 -- by Dreamsorcerer
Upgraded the vendored copy of llhttp_ to v9.1.3 -- by :user:Dreamsorcerer
Thanks to :user:kenballus for reporting this, see
https://github.com/aio-libs/aiohttp/security/advisories/GHSA-pjjw-qhg8-p2p9.
.. _llhttp: https://llhttp.org
(#7647)
Updated Python parser to comply with RFCs 9110/9112 -- by :user:Dreamorcerer
Thanks to :user:kenballus for reporting this, see
https://github.com/aio-libs/aiohttp/security/advisories/GHSA-gfw2-4jvh-wgfg.
(#7663)
Added fallback_charset_resolver parameter in ClientSession to allow a user-supplied
character set detection function.
Character set detection will no longer be included in 3.9 as a default. If this feature is needed,
please use fallback_charset_resolver <https://docs.aiohttp.org/en/stable/client_advanced.html#character-set-detection>_.
(#7561)
Enabled lenient response parsing for more flexible parsing in the client
(this should resolve some regressions when dealing with badly formatted HTTP responses). -- by :user:Dreamsorcerer
(#7490)
Fixed PermissionError when .netrc is unreadable due to permissions.
(#7237)
Fixed output of parsing errors pointing to a \n. -- by :user:Dreamsorcerer
(#7468)
Fixed GunicornWebWorker max_requests_jitter not working.
(#7518)
Fixed sorting in filter_cookies to use cookie with longest path. -- by :user:marq24.
(#7577)
Fixed display of BadStatusLine messages from llhttp_. -- by :user:Dreamsorcerer
(#7651)
Upgraded the vendored copy of llhttp_ to v8.1.1 -- by webknjaz and Dreamsorcerer.
Upgraded the vendored copy of llhttp_ to v8.1.1 -- by :user:webknjaz
and :user:Dreamsorcerer.
Thanks to :user:sethmlarson for reporting this and providing us with
comprehensive reproducer, workarounds and fixing details! For more
information, see
https://github.com/aio-libs/aiohttp/security/advisories/GHSA-45c4-8wx5-qw6w.
.. _llhttp: https://llhttp.org
(#7346)
Added information to C parser exceptions to show which character caused the error. -- by :user:Dreamsorcerer
(#7366)
Fixed a transport is :data:None error -- by :user:Dreamsorcerer.
(#3355)
Fixed incorrectly overwriting cookies with the same name and domain, but different path.
ConnectionResetError not being raised after client disconnection in SSL environments.
(#7180)Removed a deprecated usage of func:pytest.warns(None) in tests.
Attention!
This is the last aiohttp release tested under Python 3.6. The 3.9 stream is dropping it from the CI and the distribution package metadata.
Increased the upper boundary of the multidict:index dependency to allow for the version 6 -- by hugovk.
It used to be limited below version 7 in aiohttp v3.8.1 but was lowered in v3.8.2 via 6550 and never brought back, causing problems with dependency pins when upgrading. aiohttp v3.8.3 fixes that by recovering the original boundary of < 7. (#6950)
Note
This release has some compatibility fixes for Python 3.11 but it may still have some quirks. Some tests are still flaky in the CI.
Caution!
This release has been yanked from PyPI. Modern pip will not pick it up automatically. The reason is that is has multidict < 6 set in the distribution package metadata (see 6950). Please, use aiohttp ~= 3.8.3, != 3.8.1 instead, if you can.
Added support for registering OPTIONS HTTP method handlers via ~aiohttp.web.RouteTableDef. (#4663)
Started supporting authority-form and absolute-form URLs on the server-side. (#6227)
Fixed Python 3.11 incompatibilities by using Cython 0.29.25. (#6396)
Extended the sock argument typing declaration of the ~aiohttp.web.run_app function as optionally accepting iterables. (#6401)
Fixed a regression where ~asyncio.CancelledError occurs on client disconnection. (#6719)
Started exporting ~aiohttp.web.PrefixedSubAppResource under aiohttp.web -- by Dreamsorcerer.
This fixes a regression introduced by 3469. (#6889)
Dropped the object type possibility from the aiohttp.ClientSession.timeout property return type declaration. (#6917), (#6923)
Added clarification on configuring the app object with settings such as a database connection. (#4137)
Extended the sock argument typing declaration of the ~aiohttp.web.run_app function as optionally accepting iterables. (#6401)
Dropped the object type possibility from the aiohttp.ClientSession.timeout property return type declaration. (#6917), (#6923)
Dropped Python 3.5 support, aiohttp only works under Python 3.6 and higher from now on. (#4046)
Removed a deprecated usage of pytest.warns(None) in tests. (#6663)
(#6369), (#6399), (#6550), (#6708), (#6757), (#6857), (#6872).
Removed a deprecated usage of func:pytest.warns(None) in tests.
Note
This release has some compatibility fixes for Python 3.11 but it may still have some quirks. Some tests are still flaky in the CI.
Attention!
This is the last aiohttp release tested under Python 3.6. The 3.9 stream is dropping it from the CI and the distribution package metadata.
Added support for registering OPTIONS HTTP method handlers via ~aiohttp.web.RouteTableDef. (#4663)
Started supporting authority-form and absolute-form URLs on the server-side. (#6227)
Fixed Python 3.11 incompatibilities by using Cython 0.29.25. (#6396)
Extended the sock argument typing declaration of the ~aiohttp.web.run_app function as optionally accepting iterables. (#6401)
Fixed a regression where ~asyncio.CancelledError occurs on client disconnection. (#6719)
Started exporting ~aiohttp.web.PrefixedSubAppResource under aiohttp.web -- by Dreamsorcerer.
This fixes a regression introduced by 3469. (#6889)
Dropped the object type possibility from the aiohttp.ClientSession.timeout property return type declaration. (#6917), (#6923)
Added clarification on configuring the app object with settings such as a database connection. (#4137)
Extended the sock argument typing declaration of the ~aiohttp.web.run_app function as optionally accepting iterables. (#6401)
Dropped the object type possibility from the aiohttp.ClientSession.timeout property return type declaration. (#6917), (#6923)
Dropped Python 3.5 support, aiohttp only works under Python 3.6 and higher from now on. (#4046)
Removed a deprecated usage of pytest.warns(None) in tests. (#6663)
(#6369), (#6399), (#6550), (#6708), (#6757), (#6857), (#6872).
Support registering OPTIONS HTTP method handlers via RouteTableDef. #4663
Started supporting authority-form and absolute-form URLs on the server-side. #6227
Fix Python 3.11 alpha incompatibilities by using Cython 0.29.25 #6396
Remove a deprecated usage of pytest.warns(None) #6663
Fix regression where asyncio.CancelledError occurs on client disconnection. #6719
Export ~aiohttp.web.PrefixedSubAppResource under aiohttp.web -- by Dreamsorcerer.
This fixes a regression introduced by 3469. #6889
Dropped the object type possibility from the aiohttp.ClientSession.timeout property return type declaration. #6917, #6923
Added clarification on configuring the app object with settings such as a db connection. #4137
Edited the web.run_app declaration. #6401
Dropped the object type possibility from the aiohttp.ClientSession.timeout property return type declaration. #6917, #6923
Drop Python 3.5 support, aiohttp works on 3.6+ now. #4046
Fix the error in handling the return value of getaddrinfo. getaddrinfo will return an (int, bytes) tuple, if CPython could not handle the address fami
getaddrinfo.
getaddrinfo will return an (int, bytes) tuple, if CPython could not handle the address family.
It will cause a index out of range error in aiohttp. For example, if user compile CPython with
--disable-ipv6 option but his system enable the ipv6.
(#5901)Signal from __all__, replace aiohttp.Signal with aiosignal.Signal in docs
(#6201)Dreamsorcerer.
(#6278)Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- Hanaasagi. (#5927)_
Added a GunicornWebWorker feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return web.AppRunner object. (#2988)_
Switch from http-parser to llhttp (#3561)_
Use Brotli instead of brotlipy (#3803)_
Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python mode is significantly slower than compiled one. (#3828)_
Make access log use local time with timezone (#3853)_
Implemented readuntil in StreamResponse (#4054)_
FileResponse now supports ETag. (#4594)_
Add a request handler type alias aiohttp.typedefs.Handler. (#4686)_
AioHTTPTestCase is more async friendly now.
For people who use unittest and are used to use ~unittest.TestCase it will be easier to write new test cases like the sync version of the ~unittest.TestCase class, without using the decorator @unittest_run_loop, just async def test_*. The only difference is that for the people using python3.7 and below a new dependency is needed, it is asynctestcase. (#4700)_
Add validation of HTTP header keys and values to prevent header injection. (#4818)_
Add predicate to AbstractCookieJar.clear. Add AbstractCookieJar.clear_domain to clean all domain and subdomains cookies only. (#4942)_
Add keepalive_timeout parameter to web.run_app. (#5094)_
Tracing for client sent headers (#5105)_
Make type hints for http parser stricter (#5267)_
Add final declarations for constants. (#5275)_
Switch to external frozenlist and aiosignal libraries. (#5293)_
Don't send secure cookies by insecure transports.
By default, the transport is secure if https or wss scheme is used. Use CookieJar(treat_as_secure_origin="http://127.0.0.1") to override the default security checker. (#5571)_
Always create a new event loop in aiohttp.web.run_app(). This adds better compatibility with asyncio.run() or if trying to run multiple apps in sequence. (#5572)_
Add aiohttp.pytest_plugin.AiohttpClient for static typing of pytest plugin. (#5585)_
Added a socket_factory argument to BaseTestServer. (#5844)_
Add compression strategy parameter to enable_compression method. (#5909)_
Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- Hanaasagi. (#5927)_
Switched chardet to charset-normalizer for guessing the HTTP payload body encoding -- Ousret. (#5930)_
Added optional auto_decompress argument for HttpRequestParser (#5957)_
Added support for HTTPS proxies to the extent CPython's asyncio supports it -- by bmbouter, jborean93 and webknjaz. (#5992)_
Added base_url parameter to the initializer of ~aiohttp.ClientSession. (#6013)_
Add Trove classifier and create binary wheels for 3.10. -- hugovk. (#6079)_
Started shipping platform-specific wheels with the musl tag targeting typical Alpine Linux runtimes — asvetlov. (#6139)_
Started shipping platform-specific arm64 wheels for Apple Silicon — asvetlov. (#6139)_
Modify _drain_helper() to handle concurrent await resp.write(...) or ws.send_json(...) calls without race-condition. (#2934)_
Started using MultiLoopChildWatcher when it's available under POSIX while setting up the test I/O loop. (#3450)_
Only encode content-disposition filename parameter using percent-encoding. Other parameters are encoded to quoted-string or RFC2231 extended parameter value. (#4012)_
Fixed HTTP client requests to honor no_proxy environment variables. (#4431)_
Fix supporting WebSockets proxies configured via environment variables. (#4648)_
Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations. (#4748)_
Ensure a cleanup context is cleaned up even when an exception occurs during startup. (#4799)_
Added a new exception type for Unix socket client errors which provides a more useful error message. (#4984)_
Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse (#5106)_
Only depend on typing_extensions for Python <3.8 (#5107)_
Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode (#5192)_
Fix cookies disappearing from HTTPExceptions. (#5233)_
StaticResource prefixes no longer match URLs with a non-folder prefix. For example routes.static('/foo', '/foo') no longer matches the URL /foobar. Previously, this would attempt to load the file /foo/ar. (#5250)_
Acquire the connection before running traces to prevent race condition. (#5259)_
Add missing slots to `_RequestContextManager and _WSRequestContextManager (#5329)_
Ensure sending a zero byte file does not throw an exception (round 2) (#5380)_
Set "text/plain" when data is an empty string in client requests. (#5392)_
Stop automatically releasing the ClientResponse object on calls to the ok property for the failed requests. (#5403)_
Include query parameters from params keyword argument in tracing URL. (#5432)_
Fix annotations (#5466)_
Fixed the multipart POST requests processing to always release file descriptors for the tempfile.Temporaryfile-created _io.BufferedRandom instances of files sent within multipart request bodies via HTTP POST requests -- by webknjaz. (#5494)_
Fix 0 being incorrectly treated as an immediate timeout. (#5527)_
Fixes failing tests when an environment variable <scheme>_proxy is set. (#5554)_
Replace deprecated app handler design in tests/autobahn/server.py with call to web.run_app; replace deprecated aiohttp.ws_connect calls in tests/autobahn/client.py with aiohttp.ClienSession.ws_connect. (#5606)_
Fixed test for HTTPUnauthorized that access the text argument. This is not used in any part of the code, so it's removed now. (#5657)_
Remove incorrect default from docs (#5727)_
Remove external test dependency to http://httpbin.org (#5840)_
Don't cancel current task when entering a cancelled timer. (#5853)_
Added params keyword argument to ClientSession.ws_connect. -- hoh. (#5868)_
Uses ~asyncio.ThreadedChildWatcher under POSIX to allow setting up test loop in non-main thread. (#5877)_
Fix the error in handling the return value of getaddrinfo. getaddrinfo will return an (int, bytes) tuple, if CPython could not handle the address family. It will cause a index out of range error in aiohttp. For example, if user compile CPython with --disable-ipv6 option but his system enable the ipv6. (#5901)_
Removed the deprecated loop argument from the asyncio.sleep/gather calls (#5905)_
Return None from request.if_modified_since, request.if_unmodified_since, request.if_range and response.last_modified when corresponding http date headers are invalid. (#5925)_
Fix resetting SIGCHLD signals in Gunicorn aiohttp Worker to fix subprocesses that capture output having an incorrect returncode. (#6130)_
Raise 400: Content-Length can't be present with Transfer-Encoding if both Content-Length and Transfer-Encoding are sent by peer by both C and Python implementations (#6182)_
Refactored OpenAPI/Swagger aiohttp addons, added aio-openapi (#5326)_
Fixed docs on request cookies type, so it matches what is actually used in the code (a read-only dictionary-like object). (#5725)_
Documented that the HTTP client Authorization header is removed on redirects to a different host or protocol. (#5850)_
(#3927)_, (#4247)_, (#4247)_, (#5389)_, (#5457)_, (#5486)_, (#5494)_, (#5515)_, (#5625)_, (#5635)_, (#5648)_, (#5657)_, (#5890)_, (#5914)_, (#5932)_, (#6002)_, (#6045)_, (#6131)_, (#6156)_, (#6165)_, (#6166)_
Bumped upper bound of the chardet runtime dependency to allow their v4.0 version stream. (#5366)_
Added a GunicornWebWorker feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return web.AppRunner object. #2988
Switch from http-parser to llhttp #3561
Use Brotli instead of brotlipy #3803
Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python mode is significantly slower than compiled one. #3828
Make access log use local time with timezone #3853
Implemented readuntil in StreamResponse #4054
FileResponse now supports ETag. #4594
Add a request handler type alias aiohttp.typedefs.Handler. #4686
AioHTTPTestCase is more async friendly now.
For people who use unittest and are used to use ~unittest.TestCase it will be easier to write new test cases like the sync version of the ~unittest.TestCase class, without using the decorator @unittest_run_loop, just async def test_*. The only difference is that for the people using python3.7 and below a new dependency is needed, it is asynctestcase. #4700
Add validation of HTTP header keys and values to prevent header injection. #4818
Add predicate to AbstractCookieJar.clear. Add AbstractCookieJar.clear_domain to clean all domain and subdomains cookies only. #4942
Add keepalive_timeout parameter to web.run_app. #5094
Tracing for client sent headers #5105
Make type hints for http parser stricter #5267
Add final declarations for constants. #5275
Switch to external frozenlist and aiosignal libraries. #5293
Don't send secure cookies by insecure transports.
By default, the transport is secure if https or wss scheme is used. Use CookieJar(treat_as_secure_origin="http://127.0.0.1") to override the default security checker. #5571
Always create a new event loop in aiohttp.web.run_app(). This adds better compatibility with asyncio.run() or if trying to run multiple apps in sequence. #5572
Add aiohttp.pytest_plugin.AiohttpClient for static typing of pytest plugin. #5585
Added a socket_factory argument to BaseTestServer. #5844
Add compression strategy parameter to enable_compression method. #5909
Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- Hanaasagi. #5927
Switched chardet to charset-normalizer for guessing the HTTP payload body encoding -- Ousret. #5930
Added optional auto_decompress argument for HttpRequestParser #5957
Added support for HTTPS proxies to the extent CPython's asyncio supports it -- by bmbouter, jborean93 and webknjaz. #5992
Added base_url parameter to the initializer of ~aiohttp.ClientSession. #6013
Add Trove classifier and create binary wheels for 3.10. -- hugovk. #6079
Started shipping platform-specific wheels with the musl tag targeting typical Alpine Linux runtimes — asvetlov. #6139
Started shipping platform-specific arm64 wheels for Apple Silicon — asvetlov. #6139
Modify _drain_helper() to handle concurrent await resp.write(...) or ws.send_json(...) calls without race-condition. #2934
Started using MultiLoopChildWatcher when it's available under POSIX while setting up the test I/O loop. #3450
Only encode content-disposition filename parameter using percent-encoding. Other parameters are encoded to quoted-string or RFC2231 extended parameter value. #4012
Fixed HTTP client requests to honor no_proxy environment variables. #4431
Fix supporting WebSockets proxies configured via environment variables. #4648
Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations. #4748
Ensure a cleanup context is cleaned up even when an exception occurs during startup. #4799
Added a new exception type for Unix socket client errors which provides a more useful error message. #4984
Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse #5106
Only depend on typing_extensions for Python <3.8 #5107
Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode #5192
Fix cookies disappearing from HTTPExceptions. #5233
StaticResource prefixes no longer match URLs with a non-folder prefix. For example routes.static('/foo', '/foo') no longer matches the URL /foobar. Previously, this would attempt to load the file /foo/ar. #5250
Acquire the connection before running traces to prevent race condition. #5259
Add missing slots to `_RequestContextManager and _WSRequestContextManager #5329
Ensure sending a zero byte file does not throw an exception (round 2) #5380
Set "text/plain" when data is an empty string in client requests. #5392
Stop automatically releasing the ClientResponse object on calls to the ok property for the failed requests. #5403
Include query parameters from params keyword argument in tracing URL. #5432
Fix annotations #5466
Fixed the multipart POST requests processing to always release file descriptors for the tempfile.Temporaryfile-created _io.BufferedRandom instances of files sent within multipart request bodies via HTTP POST requests -- by webknjaz. #5494
Fix 0 being incorrectly treated as an immediate timeout. #5527
Fixes failing tests when an environment variable <scheme>_proxy is set. #5554
Replace deprecated app handler design in tests/autobahn/server.py with call to web.run_app; replace deprecated aiohttp.ws_connect calls in tests/autobahn/client.py with aiohttp.ClienSession.ws_connect. #5606
Fixed test for HTTPUnauthorized that access the text argument. This is not used in any part of the code, so it's removed now. #5657
Remove incorrect default from docs #5727
Remove external test dependency to http://httpbin.org #5840
Don't cancel current task when entering a cancelled timer. #5853
Added params keyword argument to ClientSession.ws_connect. -- hoh. #5868
Uses asyncio.ThreadedChildWatcher under POSIX to allow setting up test loop in non-main thread. #5877
Fix the error in handling the return value of getaddrinfo. getaddrinfo will return an (int, bytes) tuple, if CPython could not handle the address family. It will cause a index out of range error in aiohttp. For example, if user compile CPython with --disable-ipv6 option but his system enable the ipv6. #5901
Removed the deprecated loop argument from the asyncio.sleep/gather calls #5905
Return None from request.if_modified_since, request.if_unmodified_since, request.if_range and response.last_modified when corresponding http date headers are invalid. #5925
Fix resetting SIGCHLD signals in Gunicorn aiohttp Worker to fix subprocesses that capture output having an incorrect returncode. #6130
Raise 400: Content-Length can't be present with Transfer-Encoding if both Content-Length and Transfer-Encoding are sent by peer by both C and Python implementations #6182
Refactored OpenAPI/Swagger aiohttp addons, added aio-openapi #5326
Fixed docs on request cookies type, so it matches what is actually used in the code (a read-only dictionary-like object). #5725
Documented that the HTTP client Authorization header is removed on redirects to a different host or protocol. #5850
#3927, #4247, #4247, #5389, #5457, #5486, #5494, #5515, #5625, #5635, #5648, #5657, #5890, #5914, #5932, #6002, #6045, #6131, #6156, #6165, #6166
Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- Hanaasagi. (#5927)_
Added a GunicornWebWorker feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return web.AppRunner object. (#2988)_
Switch from http-parser to llhttp (#3561)_
Use Brotli instead of brotlipy (#3803)_
Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python mode is significantly slower than compiled one. (#3828)_
Make access log use local time with timezone (#3853)_
Implemented readuntil in StreamResponse (#4054)_
FileResponse now supports ETag. (#4594)_
Add a request handler type alias aiohttp.typedefs.Handler. (#4686)_
AioHTTPTestCase is more async friendly now.
For people who use unittest and are used to use ~unittest.TestCase it will be easier to write new test cases like the sync version of the ~unittest.TestCase class, without using the decorator @unittest_run_loop, just async def test_*. The only difference is that for the people using python3.7 and below a new dependency is needed, it is asynctestcase. (#4700)_
Add validation of HTTP header keys and values to prevent header injection. (#4818)_
Add predicate to AbstractCookieJar.clear. Add AbstractCookieJar.clear_domain to clean all domain and subdomains cookies only. (#4942)_
Add keepalive_timeout parameter to web.run_app. (#5094)_
Tracing for client sent headers (#5105)_
Make type hints for http parser stricter (#5267)_
Add final declarations for constants. (#5275)_
Switch to external frozenlist and aiosignal libraries. (#5293)_
Don't send secure cookies by insecure transports.
By default, the transport is secure if https or wss scheme is used. Use CookieJar(treat_as_secure_origin="http://127.0.0.1") to override the default security checker. (#5571)_
Always create a new event loop in aiohttp.web.run_app(). This adds better compatibility with asyncio.run() or if trying to run multiple apps in sequence. (#5572)_
Add aiohttp.pytest_plugin.AiohttpClient for static typing of pytest plugin. (#5585)_
Added a socket_factory argument to BaseTestServer. (#5844)_
Add compression strategy parameter to enable_compression method. (#5909)_
Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- Hanaasagi. (#5927)_
Switched chardet to charset-normalizer for guessing the HTTP payload body encoding -- Ousret. (#5930)_
Added optional auto_decompress argument for HttpRequestParser (#5957)_
Added support for HTTPS proxies to the extent CPython's asyncio supports it -- by bmbouter, jborean93 and webknjaz. (#5992)_
Added base_url parameter to the initializer of ~aiohttp.ClientSession. (#6013)_
Add Trove classifier and create binary wheels for 3.10. -- hugovk. (#6079)_
Started shipping platform-specific wheels with the musl tag targeting typical Alpine Linux runtimes — asvetlov. (#6139)_
Started shipping platform-specific arm64 wheels for Apple Silicon — asvetlov. (#6139)_
Modify _drain_helper() to handle concurrent await resp.write(...) or ws.send_json(...) calls without race-condition. (#2934)_
Started using MultiLoopChildWatcher when it's available under POSIX while setting up the test I/O loop. (#3450)_
Only encode content-disposition filename parameter using percent-encoding. Other parameters are encoded to quoted-string or RFC2231 extended parameter value. (#4012)_
Fixed HTTP client requests to honor no_proxy environment variables. (#4431)_
Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations. (#4748)_
Ensure a cleanup context is cleaned up even when an exception occurs during startup. (#4799)_
Added a new exception type for Unix socket client errors which provides a more useful error message. (#4984)_
Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse (#5106)_
Only depend on typing_extensions for Python <3.8 (#5107)_
Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode (#5192)_
Fix cookies disappearing from HTTPExceptions. (#5233)_
StaticResource prefixes no longer match URLs with a non-folder prefix. For example routes.static('/foo', '/foo') no longer matches the URL /foobar. Previously, this would attempt to load the file /foo/ar. (#5250)_
Acquire the connection before running traces to prevent race condition. (#5259)_
Add missing slots to `_RequestContextManager and _WSRequestContextManager (#5329)_
Ensure sending a zero byte file does not throw an exception (round 2) (#5380)_
Set "text/plain" when data is an empty string in client requests. (#5392)_
Stop automatically releasing the ClientResponse object on calls to the ok property for the failed requests. (#5403)_
Include query parameters from params keyword argument in tracing URL. (#5432)_
Fix annotations (#5466)_
Fixed the multipart POST requests processing to always release file descriptors for the tempfile.Temporaryfile-created _io.BufferedRandom instances of files sent within multipart request bodies via HTTP POST requests -- by webknjaz. (#5494)_
Fix 0 being incorrectly treated as an immediate timeout. (#5527)_
Replace deprecated app handler design in tests/autobahn/server.py with call to web.run_app; replace deprecated aiohttp.ws_connect calls in tests/autobahn/client.py with aiohttp.ClienSession.ws_connect. (#5606)_
Fixed test for HTTPUnauthorized that access the text argument. This is not used in any part of the code, so it's removed now. (#5657)_
Remove incorrect default from docs (#5727)_
Remove external test dependency to http://httpbin.org (#5840)_
Don't cancel current task when entering a cancelled timer. (#5853)_
Added params keyword argument to ClientSession.ws_connect. -- hoh. (#5868)_
Uses ~asyncio.ThreadedChildWatcher under POSIX to allow setting up test loop in non-main thread. (#5877)_
Fix the error in handling the return value of getaddrinfo. getaddrinfo will return an (int, bytes) tuple, if CPython could not handle the address family. It will cause a index out of range error in aiohttp. For example, if user compile CPython with --disable-ipv6 option but his system enable the ipv6. (#5901)_
Removed the deprecated loop argument from the asyncio.sleep/gather calls (#5905)_
Return None from request.if_modified_since, request.if_unmodified_since, request.if_range and response.last_modified when corresponding http date headers are invalid. (#5925)_
Fix resetting SIGCHLD signals in Gunicorn aiohttp Worker to fix subprocesses that capture output having an incorrect returncode. (#6130)_
Raise 400: Content-Length can't be present with Transfer-Encoding if both Content-Length and Transfer-Encoding are sent by peer by both C and Python implementations (#6182)_
Refactored OpenAPI/Swagger aiohttp addons, added aio-openapi (#5326)_
Fixed docs on request cookies type, so it matches what is actually used in the code (a read-only dictionary-like object). (#5725)_
Documented that the HTTP client Authorization header is removed on redirects to a different host or protocol. (#5850)_
(#3927)_, (#4247)_, (#4247)_, (#5389)_, (#5457)_, (#5486)_, (#5494)_, (#5515)_, (#5625)_, (#5635)_, (#5648)_, (#5657)_, (#5890)_, (#5914)_, (#5932)_, (#6002)_, (#6045)_, (#6131)_, (#6156)_, (#6165)_, (#6166)_
Bumped upper bound of the chardet runtime dependency to allow their v4.0 version stream. (#5366)_
Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- Hanaasagi. (#5927)_
Added a GunicornWebWorker feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return web.AppRunner object. (#2988)_
Switch from http-parser to llhttp (#3561)_
Use Brotli instead of brotlipy (#3803)_
Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python mode is significantly slower than compiled one. (#3828)_
Make access log use local time with timezone (#3853)_
Implemented readuntil in StreamResponse (#4054)_
FileResponse now supports ETag. (#4594)_
Add a request handler type alias aiohttp.typedefs.Handler. (#4686)_
AioHTTPTestCase is more async friendly now.
For people who use unittest and are used to use ~unittest.TestCase it will be easier to write new test cases like the sync version of the ~unittest.TestCase class, without using the decorator @unittest_run_loop, just async def test_*. The only difference is that for the people using python3.7 and below a new dependency is needed, it is asynctestcase. (#4700)_
Add validation of HTTP header keys and values to prevent header injection. (#4818)_
Add predicate to AbstractCookieJar.clear. Add AbstractCookieJar.clear_domain to clean all domain and subdomains cookies only. (#4942)_
Add keepalive_timeout parameter to web.run_app. (#5094)_
Tracing for client sent headers (#5105)_
Make type hints for http parser stricter (#5267)_
Add final declarations for constants. (#5275)_
Switch to external frozenlist and aiosignal libraries. (#5293)_
Don't send secure cookies by insecure transports.
By default, the transport is secure if https or wss scheme is used. Use CookieJar(treat_as_secure_origin="http://127.0.0.1") to override the default security checker. (#5571)_
Always create a new event loop in aiohttp.web.run_app(). This adds better compatibility with asyncio.run() or if trying to run multiple apps in sequence. (#5572)_
Add aiohttp.pytest_plugin.AiohttpClient for static typing of pytest plugin. (#5585)_
Added a socket_factory argument to BaseTestServer. (#5844)_
Add compression strategy parameter to enable_compression method. (#5909)_
Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- Hanaasagi. (#5927)_
Switched chardet to charset-normalizer for guessing the HTTP payload body encoding -- Ousret. (#5930)_
Added optional auto_decompress argument for HttpRequestParser (#5957)_
Added support for HTTPS proxies to the extent CPython's asyncio supports it -- by bmbouter, jborean93 and webknjaz. (#5992)_
Add Trove classifier and create binary wheels for 3.10. -- hugovk. (#6079)_
Started shipping platform-specific wheels with the musl tag targeting typical Alpine Linux runtimes — asvetlov. (#6139)_
Started shipping platform-specific arm64 wheels for Apple Silicon — asvetlov. (#6139)_
Modify _drain_helper() to handle concurrent await resp.write(...) or ws.send_json(...) calls without race-condition. (#2934)_
Started using MultiLoopChildWatcher when it's available under POSIX while setting up the test I/O loop. (#3450)_
Only encode content-disposition filename parameter using percent-encoding. Other parameters are encoded to quoted-string or RFC2231 extended parameter value. (#4012)_
Fixed HTTP client requests to honor no_proxy environment variables. (#4431)_
Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations. (#4748)_
Ensure a cleanup context is cleaned up even when an exception occurs during startup. (#4799)_
Added a new exception type for Unix socket client errors which provides a more useful error message. (#4984)_
Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse (#5106)_
Only depend on typing_extensions for Python <3.8 (#5107)_
Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode (#5192)_
Fix cookies disappearing from HTTPExceptions. (#5233)_
Acquire the connection before running traces to prevent race condition. (#5259)_
Add missing slots to `_RequestContextManager and _WSRequestContextManager (#5329)_
Ensure sending a zero byte file does not throw an exception (round 2) (#5380)_
Set "text/plain" when data is an empty string in client requests. (#5392)_
Stop automatically releasing the ClientResponse object on calls to the ok property for the failed requests. (#5403)_
Include query parameters from params keyword argument in tracing URL. (#5432)_
Fix annotations (#5466)_
Fixed the multipart POST requests processing to always release file descriptors for the tempfile.Temporaryfile-created _io.BufferedRandom instances of files sent within multipart request bodies via HTTP POST requests -- by webknjaz. (#5494)_
Fix 0 being incorrectly treated as an immediate timeout. (#5527)_
Replace deprecated app handler design in tests/autobahn/server.py with call to web.run_app; replace deprecated aiohttp.ws_connect calls in tests/autobahn/client.py with aiohttp.ClienSession.ws_connect. (#5606)_
Fixed test for HTTPUnauthorized that access the text argument. This is not used in any part of the code, so it's removed now. (#5657)_
Remove incorrect default from docs (#5727)_
Remove external test dependency to http://httpbin.org (#5840)_
Don't cancel current task when entering a cancelled timer. (#5853)_
Added params keyword argument to ClientSession.ws_connect. -- hoh. (#5868)_
Uses ~asyncio.ThreadedChildWatcher under POSIX to allow setting up test loop in non-main thread. (#5877)_
Fix the error in handling the return value of getaddrinfo. getaddrinfo will return an (int, bytes) tuple, if CPython could not handle the address family. It will cause a index out of range error in aiohttp. For example, if user compile CPython with --disable-ipv6 option but his system enable the ipv6. (#5901)_
Removed the deprecated loop argument from the asyncio.sleep/gather calls (#5905)_
Return None from request.if_modified_since, request.if_unmodified_since, request.if_range and response.last_modified when corresponding http date headers are invalid. (#5925)_
Fix resetting SIGCHLD signals in Gunicorn aiohttp Worker to fix subprocesses that capture output having an incorrect returncode. (#6130)_
Refactored OpenAPI/Swagger aiohttp addons, added aio-openapi (#5326)_
Fixed docs on request cookies type, so it matches what is actually used in the code (a read-only dictionary-like object). (#5725)_
Documented that the HTTP client Authorization header is removed on redirects to a different host or protocol. (#5850)_
(#3927)_, (#4247)_, (#4247)_, (#5389)_, (#5457)_, (#5486)_, (#5494)_, (#5515)_, (#5625)_, (#5635)_, (#5648)_, (#5657)_, (#5890)_, (#5914)_, (#5932)_, (#6002)_, (#6045)_, (#6131)_, (#6156)_, (#6165)_, (#6166)_
Bumped upper bound of the chardet runtime dependency to allow their v4.0 version stream. (#5366)_
Bumped upper bound of the chardet runtime dependency to allow their v4.0 version stream. #5366 _
(SECURITY BUG) Started preventing open redirects in the aiohttp.web.normalize_path_middleware middleware. For more details, see https://github.com/aio
(SECURITY BUG) Started preventing open redirects in the aiohttp.web.normalize_path_middleware middleware. For more details, see https://github.com/aio-libs/aiohttp/security/advisories/GHSA-v6wp-4m6f-gcjg.
Thanks to Beast Glatisant for finding the first instance of this issue and Jelmer Vernooij for reporting and tracking it down in aiohttp. #5497
Fix interpretation difference of the pure-Python and the Cython-based HTTP parsers construct a yarl.URL object for HTTP request-target.
Before this fix, the Python parser would turn the URI's absolute-path for //some-path into / while the Cython code preserved it as //some-path. Now, both do the latter. #5498
Make BaseConnector.close() a coroutine and wait until the client closes all connections. Drop deprecated "with Connector():" syntax. #3736 _
#3803 <https://github.com/aio-libs/aiohttp/issues/3803>_#4077 <https://github.com/aio-libs/aiohttp/issues/4077>_#3532 <https://github.com/aio-libs/aiohttp/issues/3532>_web_middlewares.normalize_path_middleware behavior for patch without slash.
#3669 <https://github.com/aio-libs/aiohttp/issues/3669>_#3701 <https://github.com/aio-libs/aiohttp/issues/3701>_BaseConnector.close() a coroutine and wait until the client closes all connections. Drop deprecated "with Connector():" syntax.
#3736 <https://github.com/aio-libs/aiohttp/issues/3736>_sock_read timeout each time data is received for a aiohttp.client response.
#3808 <https://github.com/aio-libs/aiohttp/issues/3808>_#3880 <https://github.com/aio-libs/aiohttp/issues/3880>_#5156 <https://github.com/aio-libs/aiohttp/issues/5156>_#5163 <https://github.com/aio-libs/aiohttp/issues/5163>_#5230 <https://github.com/aio-libs/aiohttp/issues/5230>_aiohttp.web.FileResponse.
#3958 <https://github.com/aio-libs/aiohttp/issues/3958>_#3964 <https://github.com/aio-libs/aiohttp/issues/3964>_aiohttp.client.request.
#4603 <https://github.com/aio-libs/aiohttp/issues/4603>_#5228 <https://github.com/aio-libs/aiohttp/issues/5228>_#4102 <https://github.com/aio-libs/aiohttp/issues/4102>_Fixed static files handling for loops without .sendfile() support #5149 _
.sendfile() support
#5149 <https://github.com/aio-libs/aiohttp/issues/5149>_Fixed a type error caused by the conditional import of Protocol. #5111 _
Protocol.
#5111 <https://github.com/aio-libs/aiohttp/issues/5111>_#4901 <https://github.com/aio-libs/aiohttp/issues/4901>_#4957 <https://github.com/aio-libs/aiohttp/issues/4957>_typing_extensions library.
#5107 <https://github.com/aio-libs/aiohttp/issues/5107>_ThreadedResolver.resolve to
return the resolved IP as the hostname in each record, which prevented
validation of HTTPS connections.
#5110 <https://github.com/aio-libs/aiohttp/issues/5110>_#5115 <https://github.com/aio-libs/aiohttp/issues/5115>_#5116 <https://github.com/aio-libs/aiohttp/issues/5116>_#5124 <https://github.com/aio-libs/aiohttp/issues/5124>_web.run_app() about Python version checking on Windows
#5127 <https://github.com/aio-libs/aiohttp/issues/5127>_Response headers are now prepared prior to running on_response_prepare hooks, directly before headers are sent to the client. #1958 _
on_response_prepare hooks, directly before headers are sent to the client.
#1958 <https://github.com/aio-libs/aiohttp/issues/1958>_quote_cookie option to CookieJar, a way to skip quotation wrapping of cookies containing special characters.
#2571 <https://github.com/aio-libs/aiohttp/issues/2571>_AccessLogger.log with the current exception available from sys.exc_info().
#3557 <https://github.com/aio-libs/aiohttp/issues/3557>_web.UrlDispatcher.add_routes and web.Application.add_routes return a list
of registered AbstractRoute instances. AbstractRouteDef.register (and all
subclasses) return a list of registered resources registered resource.
#3866 <https://github.com/aio-libs/aiohttp/issues/3866>_#3882 <https://github.com/aio-libs/aiohttp/issues/3882>_OSError on reading/writing instead.
#4080 <https://github.com/aio-libs/aiohttp/issues/4080>_#4189 <https://github.com/aio-libs/aiohttp/issues/4189>_ClientSession.timeout property.
#4191 <https://github.com/aio-libs/aiohttp/issues/4191>_#4224 <https://github.com/aio-libs/aiohttp/issues/4224>_loop.sendfile() instead of custom implementation if available.
#4269 <https://github.com/aio-libs/aiohttp/issues/4269>_#4393 <https://github.com/aio-libs/aiohttp/issues/4393>_#4402 <https://github.com/aio-libs/aiohttp/issues/4402>_read_bufsize argument.
#4453 <https://github.com/aio-libs/aiohttp/issues/4453>_#4513 <https://github.com/aio-libs/aiohttp/issues/4513>_method and url attributes to TraceRequestChunkSentParams and TraceResponseChunkReceivedParams.
#4674 <https://github.com/aio-libs/aiohttp/issues/4674>_#4711 <https://github.com/aio-libs/aiohttp/issues/4711>_#4850 <https://github.com/aio-libs/aiohttp/issues/4850>_None is passed in as the host.
#4894 <https://github.com/aio-libs/aiohttp/issues/4894>_http_parser to 2.9.4
#5070 <https://github.com/aio-libs/aiohttp/issues/5070>_Fix keepalive connections not being closed in time
#3296 <https://github.com/aio-libs/aiohttp/issues/3296>_
Fix failed websocket handshake leaving connection hanging.
#3380 <https://github.com/aio-libs/aiohttp/issues/3380>_
Fix tasks cancellation order on exit. The run_app task needs to be cancelled first for cleanup hooks to run with all tasks intact.
#3805 <https://github.com/aio-libs/aiohttp/issues/3805>_
Don't start heartbeat until writer is set
#4062 <https://github.com/aio-libs/aiohttp/issues/4062>
Fix handling of multipart file uploads without a content type.
#4089 <https://github.com/aio-libs/aiohttp/issues/4089>_
Preserve view handler function attributes across middlewares
#4174 <https://github.com/aio-libs/aiohttp/issues/4174>_
Fix the string representation of ServerDisconnectedError.
#4175 <https://github.com/aio-libs/aiohttp/issues/4175>_
Raising RuntimeError when trying to get encoding from not read body
#4214 <https://github.com/aio-libs/aiohttp/issues/4214>_
Remove warning messages from noop.
#4282 <https://github.com/aio-libs/aiohttp/issues/4282>_
Raise ClientPayloadError if FormData re-processed.
#4345 <https://github.com/aio-libs/aiohttp/issues/4345>_
Fix a warning about unfinished task in web_protocol.py
#4408 <https://github.com/aio-libs/aiohttp/issues/4408>_
Fixed 'deflate' compression. According to RFC 2616 now.
#4506 <https://github.com/aio-libs/aiohttp/issues/4506>_
Fixed OverflowError on platforms with 32-bit time_t
#4515 <https://github.com/aio-libs/aiohttp/issues/4515>_
Fixed request.body_exists returns wrong value for methods without body.
#4528 <https://github.com/aio-libs/aiohttp/issues/4528>_
Fix connecting to link-local IPv6 addresses.
#4554 <https://github.com/aio-libs/aiohttp/issues/4554>_
Fix a problem with connection waiters that are never awaited.
#4562 <https://github.com/aio-libs/aiohttp/issues/4562>_
Always make sure transport is not closing before reuse a connection.
Reuse a protocol based on keepalive in headers is unreliable.
For example, uWSGI will not support keepalive even it serves a
HTTP 1.1 request, except explicitly configure uWSGI with a
--http-keepalive option.
Servers designed like uWSGI could cause aiohttp intermittently
raise a ConnectionResetException when the protocol poll runs
out and some protocol is reused.
#4587 <https://github.com/aio-libs/aiohttp/issues/4587>_
Handle the last CRLF correctly even if it is received via separate TCP segment.
#4630 <https://github.com/aio-libs/aiohttp/issues/4630>_
Fix the register_resource function to validate route name before splitting it so that route name can include python keywords.
#4691 <https://github.com/aio-libs/aiohttp/issues/4691>_
Improve typing annotations for web.Request, aiohttp.ClientResponse and
multipart module.
#4736 <https://github.com/aio-libs/aiohttp/issues/4736>_
Fix resolver task is not awaited when connector is cancelled
#4795 <https://github.com/aio-libs/aiohttp/issues/4795>_
Fix a bug "Aiohttp doesn't return any error on invalid request methods"
#4798 <https://github.com/aio-libs/aiohttp/issues/4798>_
Fix HEAD requests for static content.
#4809 <https://github.com/aio-libs/aiohttp/issues/4809>_
Fix incorrect size calculation for memoryview
#4890 <https://github.com/aio-libs/aiohttp/issues/4890>_
Add HTTPMove to all_.
#4897 <https://github.com/aio-libs/aiohttp/issues/4897>_
Fixed the type annotations in the tracing module.
#4912 <https://github.com/aio-libs/aiohttp/issues/4912>_
Fix typing for multipart __aiter__.
#4931 <https://github.com/aio-libs/aiohttp/issues/4931>_
Fix for race condition on connections in BaseConnector that leads to exceeding the connection limit.
#4936 <https://github.com/aio-libs/aiohttp/issues/4936>_
Add forced UTF-8 encoding for application/rdap+json responses.
#4938 <https://github.com/aio-libs/aiohttp/issues/4938>_
Fix inconsistency between Python and C http request parsers in parsing pct-encoded URL.
#4972 <https://github.com/aio-libs/aiohttp/issues/4972>_
Fix connection closing issue in HEAD request.
#5012 <https://github.com/aio-libs/aiohttp/issues/5012>_
Fix type hint on BaseRunner.addresses (from List[str] to List[Any])
#5086 <https://github.com/aio-libs/aiohttp/issues/5086>_
Make web.run_app() more responsive to Ctrl+C on Windows for Python < 3.8. It slightly
increases CPU load as a side effect.
#5098 <https://github.com/aio-libs/aiohttp/issues/5098>_
#3376 <https://github.com/aio-libs/aiohttp/issues/3376>_ttl_dns_cache default value
#3512 <https://github.com/aio-libs/aiohttp/issues/3512>_#4201 <https://github.com/aio-libs/aiohttp/issues/4201>_Optional[str] to Optional[bool]
#4204 <https://github.com/aio-libs/aiohttp/issues/4204>_ttl_dns_cache type from int to Optional[int].
#4270 <https://github.com/aio-libs/aiohttp/issues/4270>_#4272 <https://github.com/aio-libs/aiohttp/issues/4272>_#4285 <https://github.com/aio-libs/aiohttp/issues/4285>_#4312 <https://github.com/aio-libs/aiohttp/issues/4312>_#4314 <https://github.com/aio-libs/aiohttp/issues/4314>_#4810 <https://github.com/aio-libs/aiohttp/issues/4810>_#4986 <https://github.com/aio-libs/aiohttp/issues/4986>_aiohttp-sse-client library to third party usage list.
#5084 <https://github.com/aio-libs/aiohttp/issues/5084>_#2856 <https://github.com/aio-libs/aiohttp/issues/2856>, #4218 <https://github.com/aio-libs/aiohttp/issues/4218>, #4250 <https://github.com/aio-libs/aiohttp/issues/4250>_Nothing published for this version
Nothing published for this version
Pin yarl to <1.6.0 to avoid buggy behavior that will be fixed by the next aiohttp release.
Pin yarl to <1.6.0 to avoid buggy behavior that will be fixed by the next aiohttp release.
Made exceptions pickleable. Also changed the repr of some exceptions. #4077 _
It contains several bufixes.
#4077 <https://github.com/aio-libs/aiohttp/issues/4077>_Iterable type hint instead of Sequence for Application middleware
parameter. #4125 <https://github.com/aio-libs/aiohttp/issues/4125>_sock_read timeout each time data is received for a
aiohttp.ClientResponse. #3808 <https://github.com/aio-libs/aiohttp/issues/3808>_#4063 <https://github.com/aio-libs/aiohttp/issues/4063>_ClientConnectorError;
self.ssl == None means default SSL context, not SSL disabled #4097 <https://github.com/aio-libs/aiohttp/issues/4097>_#4106 <https://github.com/aio-libs/aiohttp/issues/4106>_#2469 <https://github.com/aio-libs/aiohttp/issues/2469>_#4100 <https://github.com/aio-libs/aiohttp/issues/4100>_#4108 <https://github.com/aio-libs/aiohttp/issues/4108>_#4102 <https://github.com/aio-libs/aiohttp/issues/4102>_Nothing published for this version
Nothing published for this version
Nothing published for this version
Compatibility with Python 3.8. #4056 _
#4056 <https://github.com/aio-libs/aiohttp/issues/4056>_#4068 <https://github.com/aio-libs/aiohttp/issues/4068>_ssl.OP_NO_COMPRESSION is
unavailable because the runtime is built against
an outdated OpenSSL.
#4052 <https://github.com/aio-libs/aiohttp/issues/4052>_#4057 <https://github.com/aio-libs/aiohttp/issues/4057>_#3723 <https://github.com/aio-libs/aiohttp/issues/3723>_Nothing published for this version
Nothing published for this version
Modify documentation for Background Tasks to remove deprecated usage of event loop. #3526 _
#3629 <https://github.com/aio-libs/aiohttp/issues/3629>_Transfer-Encoding: chunked header from websocket responses to be compatible with more http proxy servers.
#3798 <https://github.com/aio-libs/aiohttp/issues/3798>_#3980 <https://github.com/aio-libs/aiohttp/issues/3980>_Raise a ClientResponseError instead of an AssertionError for a blank
HTTP Reason Phrase.
#3532 <https://github.com/aio-libs/aiohttp/issues/3532>_
Fix an issue where cookies would sometimes not be set during a redirect.
#3576 <https://github.com/aio-libs/aiohttp/issues/3576>_
Change normalize_path_middleware to use 308 redirect instead of 301.
This behavior should prevent clients from being unable to use PUT/POST
methods on endpoints that are redirected because of a trailing slash.
#3579 <https://github.com/aio-libs/aiohttp/issues/3579>_
Drop the processed task from all_tasks() list early. It prevents logging about a task with unhandled exception when the server is used in conjunction with asyncio.run().
#3587 <https://github.com/aio-libs/aiohttp/issues/3587>_
Signal type annotation changed from Signal[Callable[['TraceConfig'], Awaitable[None]]] to Signal[Callable[ClientSession, SimpleNamespace, ...].
#3595 <https://github.com/aio-libs/aiohttp/issues/3595>_
Use sanitized URL as Location header in redirects
#3614 <https://github.com/aio-libs/aiohttp/issues/3614>_
Improve typing annotations for multipart.py along with changes required
by mypy in files that references multipart.py.
#3621 <https://github.com/aio-libs/aiohttp/issues/3621>_
Close session created inside aiohttp.request when unhandled exception occurs
#3628 <https://github.com/aio-libs/aiohttp/issues/3628>_
Cleanup per-chunk data in generic data read. Memory leak fixed.
#3631 <https://github.com/aio-libs/aiohttp/issues/3631>_
Use correct type for add_view and family
#3633 <https://github.com/aio-libs/aiohttp/issues/3633>_
Fix keepalive field in slots of RequestHandler.
#3644 <https://github.com/aio-libs/aiohttp/issues/3644>
Properly handle ConnectionResetError, to silence the "Cannot write to closing
transport" exception when clients disconnect uncleanly.
#3648 <https://github.com/aio-libs/aiohttp/issues/3648>_
Suppress pytest warnings due to test_utils classes
#3660 <https://github.com/aio-libs/aiohttp/issues/3660>_
Fix overshadowing of overlapped sub-application prefixes.
#3701 <https://github.com/aio-libs/aiohttp/issues/3701>_
Fixed return type annotation for WSMessage.json()
#3720 <https://github.com/aio-libs/aiohttp/issues/3720>_
Properly expose TooManyRedirects publicly as documented.
#3818 <https://github.com/aio-libs/aiohttp/issues/3818>_
Fix missing brackets for IPv6 in proxy CONNECT request
#3841 <https://github.com/aio-libs/aiohttp/issues/3841>_
Make the signature of aiohttp.test_utils.TestClient.request match asyncio.ClientSession.request according to the docs
#3852 <https://github.com/aio-libs/aiohttp/issues/3852>_
Use correct style for re-exported imports, makes mypy --strict mode happy.
#3868 <https://github.com/aio-libs/aiohttp/issues/3868>_
Fixed type annotation for add_view method of UrlDispatcher to accept any subclass of View
#3880 <https://github.com/aio-libs/aiohttp/issues/3880>_
Made cython HTTP parser set Reason-Phrase of the response to an empty string if it is missing.
#3906 <https://github.com/aio-libs/aiohttp/issues/3906>_
Add URL to the string representation of ClientResponseError.
#3959 <https://github.com/aio-libs/aiohttp/issues/3959>_
Accept istr keys in LooseHeaders type hints.
#3976 <https://github.com/aio-libs/aiohttp/issues/3976>_
Fixed race conditions in resolve_host caching and throttling when tracing is enabled.
#4013 <https://github.com/aio-libs/aiohttp/issues/4013>
For URLs like "unix://localhost/..." set Host HTTP header to "localhost" instead of "localhost:None".
#4039 <https://github.com/aio-libs/aiohttp/issues/4039>_
#3526 <https://github.com/aio-libs/aiohttp/issues/3526>_if __name__ == '__main__': in server examples.
#3775 <https://github.com/aio-libs/aiohttp/issues/3775>_#3783 <https://github.com/aio-libs/aiohttp/issues/3783>_web.BaseRequest.path and web.BaseRequest.raw_path.
#3791 <https://github.com/aio-libs/aiohttp/issues/3791>_#3964 <https://github.com/aio-libs/aiohttp/issues/3964>_Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →