Debian Codegraph @

third_party/python/aiohttp/CHANGES.rst

raw
1 ..
2 You should *NOT* be adding new change log entries to this file, this
3 file is managed by towncrier. You *may* edit previous change logs to
4 fix problems like typo corrections or such.
5 To add a new change log entry, please see
6 https://pip.pypa.io/en/latest/development/#adding-a-news-entry
7 we named the news folder "changes".
8
9 WARNING: Don't drop the next directive!
10
11 .. towncrier release notes start
12
13 3.10.11 (2024-11-13)
14 ====================
15
16 Bug fixes
17 ---------
18
19 - Authentication provided by a redirect now takes precedence over provided ``auth`` when making requests with the client -- by :user:`PLPeeters`.
20
21
22 *Related issues and pull requests on GitHub:*
23 :issue:`9436`.
24
25
26
27 - Fixed :py:meth:`WebSocketResponse.close() <aiohttp.web.WebSocketResponse.close>` to discard non-close messages within its timeout window after sending close -- by :user:`lenard-mosys`.
28
29
30 *Related issues and pull requests on GitHub:*
31 :issue:`9506`.
32
33
34
35 - Fixed a deadlock that could occur while attempting to get a new connection slot after a timeout -- by :user:`bdraco`.
36
37 The connector was not cancellation-safe.
38
39
40 *Related issues and pull requests on GitHub:*
41 :issue:`9670`, :issue:`9671`.
42
43
44
45 - Fixed the WebSocket flow control calculation undercounting with multi-byte data -- by :user:`bdraco`.
46
47
48 *Related issues and pull requests on GitHub:*
49 :issue:`9686`.
50
51
52
53 - Fixed incorrect parsing of chunk extensions with the pure Python parser -- by :user:`bdraco`.
54
55
56 *Related issues and pull requests on GitHub:*
57 :issue:`9851`.
58
59
60
61 - Fixed system routes polluting the middleware cache -- by :user:`bdraco`.
62
63
64 *Related issues and pull requests on GitHub:*
65 :issue:`9852`.
66
67
68
69
70 Removals and backward incompatible breaking changes
71 ---------------------------------------------------
72
73 - Improved performance of the connector when a connection can be reused -- by :user:`bdraco`.
74
75 If ``BaseConnector.connect`` has been subclassed and replaced with custom logic, the ``ceil_timeout`` must be added.
76
77
78 *Related issues and pull requests on GitHub:*
79 :issue:`9600`.
80
81
82
83
84 Miscellaneous internal changes
85 ------------------------------
86
87 - Improved performance of the client request lifecycle when there are no cookies -- by :user:`bdraco`.
88
89
90 *Related issues and pull requests on GitHub:*
91 :issue:`9470`.
92
93
94
95 - Improved performance of sending client requests when the writer can finish synchronously -- by :user:`bdraco`.
96
97
98 *Related issues and pull requests on GitHub:*
99 :issue:`9485`.
100
101
102
103 - Improved performance of serializing HTTP headers -- by :user:`bdraco`.
104
105
106 *Related issues and pull requests on GitHub:*
107 :issue:`9603`.
108
109
110
111 - Passing ``enable_cleanup_closed`` to :py:class:`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 :user:`bdraco`.
112
113
114 *Related issues and pull requests on GitHub:*
115 :issue:`9726`, :issue:`9736`.
116
117
118
119 ----
120
121
122
123 3.10.10 (2024-10-10)
124 ====================
125
126 Bug fixes
127 ---------
128
129 - Fixed error messages from :py:class:`~aiohttp.resolver.AsyncResolver` being swallowed -- by :user:`bdraco`.
130
131
132 *Related issues and pull requests on GitHub:*
133 :issue:`9451`, :issue:`9455`.
134
135
136
137
138 Features
139 --------
140
141 - Added :exc:`aiohttp.ClientConnectorDNSError` for differentiating DNS resolution errors from other connector errors -- by :user:`mstojcevich`.
142
143
144 *Related issues and pull requests on GitHub:*
145 :issue:`8455`.
146
147
148
149
150 Miscellaneous internal changes
151 ------------------------------
152
153 - Simplified DNS resolution throttling code to reduce chance of race conditions -- by :user:`bdraco`.
154
155
156 *Related issues and pull requests on GitHub:*
157 :issue:`9454`.
158
159
160
161
162 ----
163
164
165 3.10.9 (2024-10-04)
166 ===================
167
168 Bug fixes
169 ---------
170
171 - Fixed proxy headers being used in the ``ConnectionKey`` hash when a proxy was not being used -- by :user:`bdraco`.
172
173 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.
174
175
176 *Related issues and pull requests on GitHub:*
177 :issue:`9368`.
178
179
180
181 - Widened the type of the ``trace_request_ctx`` parameter of
182 :meth:`ClientSession.request() <aiohttp.ClientSession.request>` and friends
183 -- by :user:`layday`.
184
185
186 *Related issues and pull requests on GitHub:*
187 :issue:`9397`.
188
189
190
191
192 Removals and backward incompatible breaking changes
193 ---------------------------------------------------
194
195 - Fixed failure to try next host after single-host connection timeout -- by :user:`brettdh`.
196
197 The default client :class:`aiohttp.ClientTimeout` params has changed to include a ``sock_connect`` timeout of 30 seconds so that this correct behavior happens by default.
198
199
200 *Related issues and pull requests on GitHub:*
201 :issue:`7342`.
202
203
204
205
206 Miscellaneous internal changes
207 ------------------------------
208
209 - Improved performance of resolving hosts with Python 3.12+ -- by :user:`bdraco`.
210
211
212 *Related issues and pull requests on GitHub:*
213 :issue:`9342`.
214
215
216
217 - Reduced memory required for timer objects created during the client request lifecycle -- by :user:`bdraco`.
218
219
220 *Related issues and pull requests on GitHub:*
221 :issue:`9406`.
222
223
224
225
226 ----
227
228
229 3.10.8 (2024-09-28)
230 ===================
231
232 Bug fixes
233 ---------
234
235 - Fixed cancellation leaking upwards on timeout -- by :user:`bdraco`.
236
237
238 *Related issues and pull requests on GitHub:*
239 :issue:`9326`.
240
241
242
243
244 ----
245
246
247 3.10.7 (2024-09-27)
248 ===================
249
250 Bug fixes
251 ---------
252
253 - Fixed assembling the :class:`~yarl.URL` for web requests when the host contains a non-default port or IPv6 address -- by :user:`bdraco`.
254
255
256 *Related issues and pull requests on GitHub:*
257 :issue:`9309`.
258
259
260
261
262 Miscellaneous internal changes
263 ------------------------------
264
265 - Improved performance of determining if a URL is absolute -- by :user:`bdraco`.
266
267 The property :attr:`~yarl.URL.absolute` is more performant than the method ``URL.is_absolute()`` and preferred when newer versions of yarl are used.
268
269
270 *Related issues and pull requests on GitHub:*
271 :issue:`9171`.
272
273
274
275 - Replaced code that can now be handled by ``yarl`` -- by :user:`bdraco`.
276
277
278 *Related issues and pull requests on GitHub:*
279 :issue:`9301`.
280
281
282
283
284 ----
285
286
287 3.10.6 (2024-09-24)
288 ===================
289
290 Bug fixes
291 ---------
292
293 - Added :exc:`aiohttp.ClientConnectionResetError`. Client code that previously threw :exc:`ConnectionResetError`
294 will now throw this -- by :user:`Dreamsorcerer`.
295
296
297 *Related issues and pull requests on GitHub:*
298 :issue:`9137`.
299
300
301
302 - Fixed an unclosed transport ``ResourceWarning`` on web handlers -- by :user:`Dreamsorcerer`.
303
304
305 *Related issues and pull requests on GitHub:*
306 :issue:`8875`.
307
308
309
310 - Fixed resolve_host() 'Task was destroyed but is pending' errors -- by :user:`Dreamsorcerer`.
311
312
313 *Related issues and pull requests on GitHub:*
314 :issue:`8967`.
315
316
317
318 - 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 :user:`ReallyReivax`.
319
320
321 *Related issues and pull requests on GitHub:*
322 :issue:`6732`.
323
324
325
326 - Fixed web router not matching pre-encoded URLs (requires yarl 1.9.6+) -- by :user:`Dreamsorcerer`.
327
328
329 *Related issues and pull requests on GitHub:*
330 :issue:`8898`, :issue:`9267`.
331
332
333
334 - Fixed an error when trying to add a route for multiple methods with a path containing a regex pattern -- by :user:`Dreamsorcerer`.
335
336
337 *Related issues and pull requests on GitHub:*
338 :issue:`8998`.
339
340
341
342 - Fixed ``Response.text`` when body is a ``Payload`` -- by :user:`Dreamsorcerer`.
343
344
345 *Related issues and pull requests on GitHub:*
346 :issue:`6485`.
347
348
349
350 - Fixed compressed requests failing when no body was provided -- by :user:`Dreamsorcerer`.
351
352
353 *Related issues and pull requests on GitHub:*
354 :issue:`9108`.
355
356
357
358 - Fixed client incorrectly reusing a connection when the previous message had not been fully sent -- by :user:`Dreamsorcerer`.
359
360
361 *Related issues and pull requests on GitHub:*
362 :issue:`8992`.
363
364
365
366 - Fixed race condition that could cause server to close connection incorrectly at keepalive timeout -- by :user:`Dreamsorcerer`.
367
368
369 *Related issues and pull requests on GitHub:*
370 :issue:`9140`.
371
372
373
374 - Fixed Python parser chunked handling with multiple Transfer-Encoding values -- by :user:`Dreamsorcerer`.
375
376
377 *Related issues and pull requests on GitHub:*
378 :issue:`8823`.
379
380
381
382 - Fixed error handling after 100-continue so server sends 500 response instead of disconnecting -- by :user:`Dreamsorcerer`.
383
384
385 *Related issues and pull requests on GitHub:*
386 :issue:`8876`.
387
388
389
390 - Stopped adding a default Content-Type header when response has no content -- by :user:`Dreamsorcerer`.
391
392
393 *Related issues and pull requests on GitHub:*
394 :issue:`8858`.
395
396
397
398 - Added support for URL credentials with empty (zero-length) username, e.g. ``https://:password@host`` -- by :user:`shuckc`
399
400
401 *Related issues and pull requests on GitHub:*
402 :issue:`6494`.
403
404
405
406 - Stopped logging exceptions from ``web.run_app()`` that would be raised regardless -- by :user:`Dreamsorcerer`.
407
408
409 *Related issues and pull requests on GitHub:*
410 :issue:`6807`.
411
412
413
414 - Implemented binding to IPv6 addresses in the pytest server fixture.
415
416
417 *Related issues and pull requests on GitHub:*
418 :issue:`4650`.
419
420
421
422 - Fixed the incorrect use of flags for ``getnameinfo()`` in the Resolver --by :user:`GitNMLee`
423
424 Link-Local IPv6 addresses can now be handled by the Resolver correctly.
425
426
427 *Related issues and pull requests on GitHub:*
428 :issue:`9032`.
429
430
431
432 - Fixed StreamResponse.prepared to return True after EOF is sent -- by :user:`arthurdarcet`.
433
434
435 *Related issues and pull requests on GitHub:*
436 :issue:`5343`.
437
438
439
440 - Changed ``make_mocked_request()`` to use empty payload by default -- by :user:`rahulnht`.
441
442
443 *Related issues and pull requests on GitHub:*
444 :issue:`7167`.
445
446
447
448 - Used more precise type for ``ClientResponseError.headers``, fixing some type errors when using them -- by :user:`Dreamsorcerer`.
449
450
451 *Related issues and pull requests on GitHub:*
452 :issue:`8768`.
453
454
455
456 - Changed behavior when returning an invalid response to send a 500 response -- by :user:`Dreamsorcerer`.
457
458
459 *Related issues and pull requests on GitHub:*
460 :issue:`8845`.
461
462
463
464 - Fixed response reading from closed session to throw an error immediately instead of timing out -- by :user:`Dreamsorcerer`.
465
466
467 *Related issues and pull requests on GitHub:*
468 :issue:`8878`.
469
470
471
472 - Fixed ``CancelledError`` from one cleanup context stopping other contexts from completing -- by :user:`Dreamsorcerer`.
473
474
475 *Related issues and pull requests on GitHub:*
476 :issue:`8908`.
477
478
479
480 - Fixed changing scheme/host in ``Response.clone()`` for absolute URLs -- by :user:`Dreamsorcerer`.
481
482
483 *Related issues and pull requests on GitHub:*
484 :issue:`8990`.
485
486
487
488 - Fixed ``Site.name`` when host is an empty string -- by :user:`Dreamsorcerer`.
489
490
491 *Related issues and pull requests on GitHub:*
492 :issue:`8929`.
493
494
495
496 - Updated Python parser to reject messages after a close message, matching C parser behaviour -- by :user:`Dreamsorcerer`.
497
498
499 *Related issues and pull requests on GitHub:*
500 :issue:`9018`.
501
502
503
504 - Fixed creation of ``SSLContext`` inside of :py:class:`aiohttp.TCPConnector` with multiple event loops in different threads -- by :user:`bdraco`.
505
506
507 *Related issues and pull requests on GitHub:*
508 :issue:`9029`.
509
510
511
512 - Fixed (on Python 3.11+) some edge cases where a task cancellation may get incorrectly suppressed -- by :user:`Dreamsorcerer`.
513
514
515 *Related issues and pull requests on GitHub:*
516 :issue:`9030`.
517
518
519
520 - Fixed exception information getting lost on ``HttpProcessingError`` -- by :user:`Dreamsorcerer`.
521
522
523 *Related issues and pull requests on GitHub:*
524 :issue:`9052`.
525
526
527
528 - Fixed ``If-None-Match`` not using weak comparison -- by :user:`Dreamsorcerer`.
529
530
531 *Related issues and pull requests on GitHub:*
532 :issue:`9063`.
533
534
535
536 - Fixed badly encoded charset crashing when getting response text instead of falling back to charset detector.
537
538
539 *Related issues and pull requests on GitHub:*
540 :issue:`9160`.
541
542
543
544 - Rejected `\n` in `reason` values to avoid sending broken HTTP messages -- by :user:`Dreamsorcerer`.
545
546
547 *Related issues and pull requests on GitHub:*
548 :issue:`9167`.
549
550
551
552 - Changed :py:meth:`ClientResponse.raise_for_status() <aiohttp.ClientResponse.raise_for_status>` to only release the connection when invoked outside an ``async with`` context -- by :user:`Dreamsorcerer`.
553
554
555 *Related issues and pull requests on GitHub:*
556 :issue:`9239`.
557
558
559
560
561 Features
562 --------
563
564 - Improved type on ``params`` to match the underlying type allowed by ``yarl`` -- by :user:`lpetre`.
565
566
567 *Related issues and pull requests on GitHub:*
568 :issue:`8564`.
569
570
571
572 - Declared Python 3.13 supported -- by :user:`bdraco`.
573
574
575 *Related issues and pull requests on GitHub:*
576 :issue:`8748`.
577
578
579
580
581 Removals and backward incompatible breaking changes
582 ---------------------------------------------------
583
584 - Improved middleware performance -- by :user:`bdraco`.
585
586 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.
587
588
589 *Related issues and pull requests on GitHub:*
590 :issue:`9200`.
591
592
593
594 - Increased minimum yarl version to 1.12.0 -- by :user:`bdraco`.
595
596
597 *Related issues and pull requests on GitHub:*
598 :issue:`9267`.
599
600
601
602
603 Improved documentation
604 ----------------------
605
606 - Clarified that ``GracefulExit`` needs to be handled in ``AppRunner`` and ``ServerRunner`` when using ``handle_signals=True``. -- by :user:`Daste745`
607
608
609 *Related issues and pull requests on GitHub:*
610 :issue:`4414`.
611
612
613
614 - Clarified that auth parameter in ClientSession will persist and be included with any request to any origin, even during redirects to different origins. -- by :user:`MaximZemskov`.
615
616
617 *Related issues and pull requests on GitHub:*
618 :issue:`6764`.
619
620
621
622 - Clarified which timeout exceptions happen on which timeouts -- by :user:`Dreamsorcerer`.
623
624
625 *Related issues and pull requests on GitHub:*
626 :issue:`8968`.
627
628
629
630 - Updated ``ClientSession`` parameters to match current code -- by :user:`Dreamsorcerer`.
631
632
633 *Related issues and pull requests on GitHub:*
634 :issue:`8991`.
635
636
637
638
639 Packaging updates and notes for downstreams
640 -------------------------------------------
641
642 - Fixed ``test_client_session_timeout_zero`` to not require internet access -- by :user:`Dreamsorcerer`.
643
644
645 *Related issues and pull requests on GitHub:*
646 :issue:`9004`.
647
648
649
650
651 Miscellaneous internal changes
652 ------------------------------
653
654 - Improved performance of making requests when there are no auto headers to skip -- by :user:`bdraco`.
655
656
657 *Related issues and pull requests on GitHub:*
658 :issue:`8847`.
659
660
661
662 - Exported ``aiohttp.TraceRequestHeadersSentParams`` -- by :user:`Hadock-is-ok`.
663
664
665 *Related issues and pull requests on GitHub:*
666 :issue:`8947`.
667
668
669
670 - Avoided tracing overhead in the http writer when there are no active traces -- by user:`bdraco`.
671
672
673 *Related issues and pull requests on GitHub:*
674 :issue:`9031`.
675
676
677
678 - Improved performance of reify Cython implementation -- by :user:`bdraco`.
679
680
681 *Related issues and pull requests on GitHub:*
682 :issue:`9054`.
683
684
685
686 - Use :meth:`URL.extend_query() <yarl.URL.extend_query>` to extend query params (requires yarl 1.11.0+) -- by :user:`bdraco`.
687
688 If yarl is older than 1.11.0, the previous slower hand rolled version will be used.
689
690
691 *Related issues and pull requests on GitHub:*
692 :issue:`9068`.
693
694
695
696 - Improved performance of checking if a host is an IP Address -- by :user:`bdraco`.
697
698
699 *Related issues and pull requests on GitHub:*
700 :issue:`9095`.
701
702
703
704 - Significantly improved performance of middlewares -- by :user:`bdraco`.
705
706 The construction of the middleware wrappers is now cached and is built once per handler instead of on every request.
707
708
709 *Related issues and pull requests on GitHub:*
710 :issue:`9158`, :issue:`9170`.
711
712
713
714 - Improved performance of web requests -- by :user:`bdraco`.
715
716
717 *Related issues and pull requests on GitHub:*
718 :issue:`9168`, :issue:`9169`, :issue:`9172`, :issue:`9174`, :issue:`9175`, :issue:`9241`.
719
720
721
722 - Improved performance of starting web requests when there is no response prepare hook -- by :user:`bdraco`.
723
724
725 *Related issues and pull requests on GitHub:*
726 :issue:`9173`.
727
728
729
730 - Significantly improved performance of expiring cookies -- by :user:`bdraco`.
731
732 Expiring cookies has been redesigned to use :mod:`heapq` instead of a linear search, to better scale.
733
734
735 *Related issues and pull requests on GitHub:*
736 :issue:`9203`.
737
738
739
740 - Significantly sped up filtering cookies -- by :user:`bdraco`.
741
742
743 *Related issues and pull requests on GitHub:*
744 :issue:`9204`.
745
746
747
748
749 ----
750
751
752 3.10.5 (2024-08-19)
753 =========================
754
755 Bug fixes
756 ---------
757
758 - Fixed :meth:`aiohttp.ClientResponse.json()` not setting ``status`` when :exc:`aiohttp.ContentTypeError` is raised -- by :user:`bdraco`.
759
760
761 *Related issues and pull requests on GitHub:*
762 :issue:`8742`.
763
764
765
766
767 Miscellaneous internal changes
768 ------------------------------
769
770 - Improved performance of the WebSocket reader -- by :user:`bdraco`.
771
772
773 *Related issues and pull requests on GitHub:*
774 :issue:`8736`, :issue:`8747`.
775
776
777
778
779 ----
780
781
782 3.10.4 (2024-08-17)
783 ===================
784
785 Bug fixes
786 ---------
787
788 - Fixed decoding base64 chunk in BodyPartReader -- by :user:`hyzyla`.
789
790
791 *Related issues and pull requests on GitHub:*
792 :issue:`3867`.
793
794
795
796 - Fixed a race closing the server-side WebSocket where the close code would not reach the client -- by :user:`bdraco`.
797
798
799 *Related issues and pull requests on GitHub:*
800 :issue:`8680`.
801
802
803
804 - Fixed unconsumed exceptions raised by the WebSocket heartbeat -- by :user:`bdraco`.
805
806 If the heartbeat ping raised an exception, it would not be consumed and would be logged as an warning.
807
808
809 *Related issues and pull requests on GitHub:*
810 :issue:`8685`.
811
812
813
814 - Fixed an edge case in the Python parser when chunk separators happen to align with network chunks -- by :user:`Dreamsorcerer`.
815
816
817 *Related issues and pull requests on GitHub:*
818 :issue:`8720`.
819
820
821
822
823 Improved documentation
824 ----------------------
825
826 - Added ``aiohttp-apischema`` to supported libraries -- by :user:`Dreamsorcerer`.
827
828
829 *Related issues and pull requests on GitHub:*
830 :issue:`8700`.
831
832
833
834
835 Miscellaneous internal changes
836 ------------------------------
837
838 - Improved performance of starting request handlers with Python 3.12+ -- by :user:`bdraco`.
839
840 This change is a followup to :issue:`8661` to make the same optimization for Python 3.12+ where the request is connected.
841
842
843 *Related issues and pull requests on GitHub:*
844 :issue:`8681`.
845
846
847
848
849 ----
850
851
852 3.10.3 (2024-08-10)
853 ========================
854
855 Bug fixes
856 ---------
857
858 - Fixed multipart reading when stream buffer splits the boundary over several read() calls -- by :user:`Dreamsorcerer`.
859
860
861 *Related issues and pull requests on GitHub:*
862 :issue:`8653`.
863
864
865
866 - Fixed :py:class:`aiohttp.TCPConnector` doing blocking I/O in the event loop to create the ``SSLContext`` -- by :user:`bdraco`.
867
868 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.
869
870
871 *Related issues and pull requests on GitHub:*
872 :issue:`8672`.
873
874
875
876
877 Miscellaneous internal changes
878 ------------------------------
879
880 - Improved performance of :py:meth:`~aiohttp.ClientWebSocketResponse.receive` and :py:meth:`~aiohttp.web.WebSocketResponse.receive` when there is no timeout. -- by :user:`bdraco`.
881
882 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 :py:meth:`~aiohttp.ClientWebSocketResponse.receive` and :py:meth:`~aiohttp.web.WebSocketResponse.receive` methods.
883
884
885 *Related issues and pull requests on GitHub:*
886 :issue:`8660`.
887
888
889
890 - Improved performance of starting request handlers with Python 3.12+ -- by :user:`bdraco`.
891
892
893 *Related issues and pull requests on GitHub:*
894 :issue:`8661`.
895
896
897
898 - Improved performance of HTTP keep-alive checks -- by :user:`bdraco`.
899
900 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.
901
902
903 *Related issues and pull requests on GitHub:*
904 :issue:`8662`.
905
906
907
908 - Improved performance of generating random WebSocket mask -- by :user:`bdraco`.
909
910
911 *Related issues and pull requests on GitHub:*
912 :issue:`8667`.
913
914
915
916
917 ----
918
919
920 3.10.2 (2024-08-08)
921 ===================
922
923 Bug fixes
924 ---------
925
926 - Fixed server checks for circular symbolic links to be compatible with Python 3.13 -- by :user:`steverep`.
927
928
929 *Related issues and pull requests on GitHub:*
930 :issue:`8565`.
931
932
933
934 - Fixed request body not being read when ignoring an Upgrade request -- by :user:`Dreamsorcerer`.
935
936
937 *Related issues and pull requests on GitHub:*
938 :issue:`8597`.
939
940
941
942 - Fixed an edge case where shutdown would wait for timeout when the handler was already completed -- by :user:`Dreamsorcerer`.
943
944
945 *Related issues and pull requests on GitHub:*
946 :issue:`8611`.
947
948
949
950 - Fixed connecting to ``npipe://``, ``tcp://``, and ``unix://`` urls -- by :user:`bdraco`.
951
952
953 *Related issues and pull requests on GitHub:*
954 :issue:`8632`.
955
956
957
958 - Fixed WebSocket ping tasks being prematurely garbage collected -- by :user:`bdraco`.
959
960 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.
961
962
963 *Related issues and pull requests on GitHub:*
964 :issue:`8641`.
965
966
967
968 - Fixed incorrectly following symlinks for compressed file variants -- by :user:`steverep`.
969
970
971 *Related issues and pull requests on GitHub:*
972 :issue:`8652`.
973
974
975
976
977 Removals and backward incompatible breaking changes
978 ---------------------------------------------------
979
980 - Removed ``Request.wait_for_disconnection()``, which was mistakenly added briefly in 3.10.0 -- by :user:`Dreamsorcerer`.
981
982
983 *Related issues and pull requests on GitHub:*
984 :issue:`8636`.
985
986
987
988
989 Contributor-facing changes
990 --------------------------
991
992 - Fixed monkey patches for ``Path.stat()`` and ``Path.is_dir()`` for Python 3.13 compatibility -- by :user:`steverep`.
993
994
995 *Related issues and pull requests on GitHub:*
996 :issue:`8551`.
997
998
999
1000
1001 Miscellaneous internal changes
1002 ------------------------------
1003
1004 - Improved WebSocket performance when messages are sent or received frequently -- by :user:`bdraco`.
1005
1006 The WebSocket heartbeat scheduling algorithm was improved to reduce the ``asyncio`` scheduling overhead by decreasing the number of ``asyncio.TimerHandle`` creations and cancellations.
1007
1008
1009 *Related issues and pull requests on GitHub:*
1010 :issue:`8608`.
1011
1012
1013
1014 - Minor improvements to various type annotations -- by :user:`Dreamsorcerer`.
1015
1016
1017 *Related issues and pull requests on GitHub:*
1018 :issue:`8634`.
1019
1020
1021
1022
1023 ----
1024
1025
1026 3.10.1 (2024-08-03)
1027 ========================
1028
1029 Bug fixes
1030 ---------
1031
1032 - Fixed WebSocket server heartbeat timeout logic to terminate :py:meth:`~aiohttp.ClientWebSocketResponse.receive` and return :py:class:`~aiohttp.ServerTimeoutError` -- by :user:`arcivanov`.
1033
1034 When a WebSocket pong message was not received, the :py:meth:`~aiohttp.ClientWebSocketResponse.receive` operation did not terminate. This change causes ``_pong_not_received`` to feed the ``reader`` an error message, causing pending :py:meth:`~aiohttp.ClientWebSocketResponse.receive` to terminate and return the error message. The error message contains the exception :py:class:`~aiohttp.ServerTimeoutError`.
1035
1036
1037 *Related issues and pull requests on GitHub:*
1038 :issue:`8540`.
1039
1040
1041
1042 - Fixed url dispatcher index not matching when a variable is preceded by a fixed string after a slash -- by :user:`bdraco`.
1043
1044
1045 *Related issues and pull requests on GitHub:*
1046 :issue:`8566`.
1047
1048
1049
1050
1051 Removals and backward incompatible breaking changes
1052 ---------------------------------------------------
1053
1054 - Creating :py:class:`aiohttp.TCPConnector`, :py:class:`aiohttp.ClientSession`, :py:class:`~aiohttp.resolver.ThreadedResolver` :py:class:`aiohttp.web.Server`, or :py:class:`aiohttp.CookieJar` instances without a running event loop now raises a :exc:`RuntimeError` -- by :user:`asvetlov`.
1055
1056 Creating these objects without a running event loop was deprecated in :issue:`3372` which was released in version 3.5.0.
1057
1058 This change first appeared in version 3.10.0 as :issue:`6378`.
1059
1060
1061 *Related issues and pull requests on GitHub:*
1062 :issue:`8555`, :issue:`8583`.
1063
1064
1065
1066
1067 ----
1068
1069
1070 3.10.0 (2024-07-30)
1071 ========================
1072
1073 Bug fixes
1074 ---------
1075
1076 - Fixed server response headers for ``Content-Type`` and ``Content-Encoding`` for
1077 static compressed files -- by :user:`steverep`.
1078
1079 Server will now respond with a ``Content-Type`` appropriate for the compressed
1080 file (e.g. ``"application/gzip"``), and omit the ``Content-Encoding`` header.
1081 Users should expect that most clients will no longer decompress such responses
1082 by default.
1083
1084
1085 *Related issues and pull requests on GitHub:*
1086 :issue:`4462`.
1087
1088
1089
1090 - Fixed duplicate cookie expiration calls in the CookieJar implementation
1091
1092
1093 *Related issues and pull requests on GitHub:*
1094 :issue:`7784`.
1095
1096
1097
1098 - Adjusted ``FileResponse`` to check file existence and access when preparing the response -- by :user:`steverep`.
1099
1100 The :py:class:`~aiohttp.web.FileResponse` class was modified to respond with
1101 403 Forbidden or 404 Not Found as appropriate. Previously, it would cause a
1102 server error if the path did not exist or could not be accessed. Checks for
1103 existence, non-regular files, and permissions were expected to be done in the
1104 route handler. For static routes, this now permits a compressed file to exist
1105 without its uncompressed variant and still be served. In addition, this
1106 changes the response status for files without read permission to 403, and for
1107 non-regular files from 404 to 403 for consistency.
1108
1109
1110 *Related issues and pull requests on GitHub:*
1111 :issue:`8182`.
1112
1113
1114
1115 - Fixed ``AsyncResolver`` to match ``ThreadedResolver`` behavior
1116 -- by :user:`bdraco`.
1117
1118 On system with IPv6 support, the :py:class:`~aiohttp.resolver.AsyncResolver` would not fallback
1119 to providing A records when AAAA records were not available.
1120 Additionally, unlike the :py:class:`~aiohttp.resolver.ThreadedResolver`, the :py:class:`~aiohttp.resolver.AsyncResolver`
1121 did not handle link-local addresses correctly.
1122
1123 This change makes the behavior consistent with the :py:class:`~aiohttp.resolver.ThreadedResolver`.
1124
1125
1126 *Related issues and pull requests on GitHub:*
1127 :issue:`8270`.
1128
1129
1130
1131 - Fixed ``ws_connect`` not respecting `receive_timeout`` on WS(S) connection.
1132 -- by :user:`arcivanov`.
1133
1134
1135 *Related issues and pull requests on GitHub:*
1136 :issue:`8444`.
1137
1138
1139
1140 - Removed blocking I/O in the event loop for static resources and refactored
1141 exception handling -- by :user:`steverep`.
1142
1143 File system calls when handling requests for static routes were moved to a
1144 separate thread to potentially improve performance. Exception handling
1145 was tightened in order to only return 403 Forbidden or 404 Not Found responses
1146 for expected scenarios; 500 Internal Server Error would be returned for any
1147 unknown errors.
1148
1149
1150 *Related issues and pull requests on GitHub:*
1151 :issue:`8507`.
1152
1153
1154
1155
1156 Features
1157 --------
1158
1159 - Added a Request.wait_for_disconnection() method, as means of allowing request handlers to be notified of premature client disconnections.
1160
1161
1162 *Related issues and pull requests on GitHub:*
1163 :issue:`2492`.
1164
1165
1166
1167 - Added 5 new exceptions: :py:exc:`~aiohttp.InvalidUrlClientError`, :py:exc:`~aiohttp.RedirectClientError`,
1168 :py:exc:`~aiohttp.NonHttpUrlClientError`, :py:exc:`~aiohttp.InvalidUrlRedirectClientError`,
1169 :py:exc:`~aiohttp.NonHttpUrlRedirectClientError`
1170
1171 :py:exc:`~aiohttp.InvalidUrlRedirectClientError`, :py:exc:`~aiohttp.NonHttpUrlRedirectClientError`
1172 are raised instead of :py:exc:`ValueError` or :py:exc:`~aiohttp.InvalidURL` when the redirect URL is invalid. Classes
1173 :py:exc:`~aiohttp.InvalidUrlClientError`, :py:exc:`~aiohttp.RedirectClientError`,
1174 :py:exc:`~aiohttp.NonHttpUrlClientError` are base for them.
1175
1176 The :py:exc:`~aiohttp.InvalidURL` now exposes a ``description`` property with the text explanation of the error details.
1177
1178 -- by :user:`setla`, :user:`AraHaan`, and :user:`bdraco`
1179
1180
1181 *Related issues and pull requests on GitHub:*
1182 :issue:`2507`, :issue:`3315`, :issue:`6722`, :issue:`8481`, :issue:`8482`.
1183
1184
1185
1186 - Added a feature to retry closed connections automatically for idempotent methods. -- by :user:`Dreamsorcerer`
1187
1188
1189 *Related issues and pull requests on GitHub:*
1190 :issue:`7297`.
1191
1192
1193
1194 - Implemented filter_cookies() with domain-matching and path-matching on the keys, instead of testing every single cookie.
1195 This may break existing cookies that have been saved with `CookieJar.save()`. Cookies can be migrated with this script::
1196
1197 import pickle
1198 with file_path.open("rb") as f:
1199 cookies = pickle.load(f)
1200
1201 morsels = [(name, m) for c in cookies.values() for name, m in c.items()]
1202 cookies.clear()
1203 for name, m in morsels:
1204 cookies[(m["domain"], m["path"].rstrip("/"))][name] = m
1205
1206 with file_path.open("wb") as f:
1207 pickle.dump(cookies, f, pickle.HIGHEST_PROTOCOL)
1208
1209
1210 *Related issues and pull requests on GitHub:*
1211 :issue:`7583`, :issue:`8535`.
1212
1213
1214
1215 - Separated connection and socket timeout errors, from ServerTimeoutError.
1216
1217
1218 *Related issues and pull requests on GitHub:*
1219 :issue:`7801`.
1220
1221
1222
1223 - Implemented happy eyeballs
1224
1225
1226 *Related issues and pull requests on GitHub:*
1227 :issue:`7954`.
1228
1229
1230
1231 - Added server capability to check for static files with Brotli compression via a ``.br`` extension -- by :user:`steverep`.
1232
1233
1234 *Related issues and pull requests on GitHub:*
1235 :issue:`8062`.
1236
1237
1238
1239
1240 Removals and backward incompatible breaking changes
1241 ---------------------------------------------------
1242
1243 - The shutdown logic in 3.9 waited on all tasks, which caused issues with some libraries.
1244 In 3.10 we've changed this logic to only wait on request handlers. This means that it's
1245 important for developers to correctly handle the lifecycle of background tasks using a
1246 library such as ``aiojobs``. If an application is using ``handler_cancellation=True`` then
1247 it is also a good idea to ensure that any :func:`asyncio.shield` calls are replaced with
1248 :func:`aiojobs.aiohttp.shield`.
1249
1250 Please read the updated documentation on these points: \
1251 https://docs.aiohttp.org/en/stable/web_advanced.html#graceful-shutdown \
1252 https://docs.aiohttp.org/en/stable/web_advanced.html#web-handler-cancellation
1253
1254 -- by :user:`Dreamsorcerer`
1255
1256
1257 *Related issues and pull requests on GitHub:*
1258 :issue:`8495`.
1259
1260
1261
1262
1263 Improved documentation
1264 ----------------------
1265
1266 - Added documentation for ``aiohttp.web.FileResponse``.
1267
1268
1269 *Related issues and pull requests on GitHub:*
1270 :issue:`3958`.
1271
1272
1273
1274 - Improved the docs for the `ssl` params.
1275
1276
1277 *Related issues and pull requests on GitHub:*
1278 :issue:`8403`.
1279
1280
1281
1282
1283 Contributor-facing changes
1284 --------------------------
1285
1286 - Enabled HTTP parser tests originally intended for 3.9.2 release -- by :user:`pajod`.
1287
1288
1289 *Related issues and pull requests on GitHub:*
1290 :issue:`8088`.
1291
1292
1293
1294
1295 Miscellaneous internal changes
1296 ------------------------------
1297
1298 - Improved URL handler resolution time by indexing resources in the UrlDispatcher.
1299 For applications with a large number of handlers, this should increase performance significantly.
1300 -- by :user:`bdraco`
1301
1302
1303 *Related issues and pull requests on GitHub:*
1304 :issue:`7829`.
1305
1306
1307
1308 - Added `nacl_middleware <https://github.com/CosmicDNA/nacl_middleware>`_ to the list of middlewares in the third party section of the documentation.
1309
1310
1311 *Related issues and pull requests on GitHub:*
1312 :issue:`8346`.
1313
1314
1315
1316 - Minor improvements to static typing -- by :user:`Dreamsorcerer`.
1317
1318
1319 *Related issues and pull requests on GitHub:*
1320 :issue:`8364`.
1321
1322
1323
1324 - Added a 3.11-specific overloads to ``ClientSession`` -- by :user:`max-muoto`.
1325
1326
1327 *Related issues and pull requests on GitHub:*
1328 :issue:`8463`.
1329
1330
1331
1332 - Simplified path checks for ``UrlDispatcher.add_static()`` method -- by :user:`steverep`.
1333
1334
1335 *Related issues and pull requests on GitHub:*
1336 :issue:`8491`.
1337
1338
1339
1340 - Avoided creating a future on every websocket receive -- by :user:`bdraco`.
1341
1342
1343 *Related issues and pull requests on GitHub:*
1344 :issue:`8498`.
1345
1346
1347
1348 - Updated identity checks for all ``WSMsgType`` type compares -- by :user:`bdraco`.
1349
1350
1351 *Related issues and pull requests on GitHub:*
1352 :issue:`8501`.
1353
1354
1355
1356 - 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 :user:`bdraco`.
1357
1358
1359 *Related issues and pull requests on GitHub:*
1360 :issue:`8510`.
1361
1362
1363
1364 - Restored :py:class:`~aiohttp.resolver.AsyncResolver` to be the default resolver. -- by :user:`bdraco`.
1365
1366 :py:class:`~aiohttp.resolver.AsyncResolver` was disabled by default because
1367 of IPv6 compatibility issues. These issues have been resolved and
1368 :py:class:`~aiohttp.resolver.AsyncResolver` is again now the default resolver.
1369
1370
1371 *Related issues and pull requests on GitHub:*
1372 :issue:`8522`.
1373
1374
1375
1376
1377 ----
1378
1379
1380 3.9.5 (2024-04-16)
1381 ==================
1382
1383 Bug fixes
1384 ---------
1385
1386 - Fixed "Unclosed client session" when initialization of
1387 :py:class:`~aiohttp.ClientSession` fails -- by :user:`NewGlad`.
1388
1389
1390 *Related issues and pull requests on GitHub:*
1391 :issue:`8253`.
1392
1393
1394
1395 - Fixed regression (from :pr:`8280`) with adding ``Content-Disposition`` to the ``form-data``
1396 part after appending to writer -- by :user:`Dreamsorcerer`/:user:`Olegt0rr`.
1397
1398
1399 *Related issues and pull requests on GitHub:*
1400 :issue:`8332`.
1401
1402
1403
1404 - Added default ``Content-Disposition`` in ``multipart/form-data`` responses to avoid broken
1405 form-data responses -- by :user:`Dreamsorcerer`.
1406
1407
1408 *Related issues and pull requests on GitHub:*
1409 :issue:`8335`.
1410
1411
1412
1413
1414 ----
1415
1416
1417 3.9.4 (2024-04-11)
1418 ==================
1419
1420 Bug fixes
1421 ---------
1422
1423 - The asynchronous internals now set the underlying causes
1424 when assigning exceptions to the future objects
1425 -- by :user:`webknjaz`.
1426
1427
1428 *Related issues and pull requests on GitHub:*
1429 :issue:`8089`.
1430
1431
1432
1433 - Treated values of ``Accept-Encoding`` header as case-insensitive when checking
1434 for gzip files -- by :user:`steverep`.
1435
1436
1437 *Related issues and pull requests on GitHub:*
1438 :issue:`8104`.
1439
1440
1441
1442 - Improved the DNS resolution performance on cache hit -- by :user:`bdraco`.
1443
1444 This is achieved by avoiding an :mod:`asyncio` task creation in this case.
1445
1446
1447 *Related issues and pull requests on GitHub:*
1448 :issue:`8163`.
1449
1450
1451 - Changed the type annotations to allow ``dict`` on :meth:`aiohttp.MultipartWriter.append`,
1452 :meth:`aiohttp.MultipartWriter.append_json` and
1453 :meth:`aiohttp.MultipartWriter.append_form` -- by :user:`cakemanny`
1454
1455
1456 *Related issues and pull requests on GitHub:*
1457 :issue:`7741`.
1458
1459
1460
1461 - Ensure websocket transport is closed when client does not close it
1462 -- by :user:`bdraco`.
1463
1464 The transport could remain open if the client did not close it. This
1465 change ensures the transport is closed when the client does not close
1466 it.
1467
1468
1469 *Related issues and pull requests on GitHub:*
1470 :issue:`8200`.
1471
1472
1473
1474 - Leave websocket transport open if receive times out or is cancelled
1475 -- by :user:`bdraco`.
1476
1477 This restores the behavior prior to the change in #7978.
1478
1479
1480 *Related issues and pull requests on GitHub:*
1481 :issue:`8251`.
1482
1483
1484
1485 - Fixed content not being read when an upgrade request was not supported with the pure Python implementation.
1486 -- by :user:`bdraco`.
1487
1488
1489 *Related issues and pull requests on GitHub:*
1490 :issue:`8252`.
1491
1492
1493
1494 - Fixed a race condition with incoming connections during server shutdown -- by :user:`Dreamsorcerer`.
1495
1496
1497 *Related issues and pull requests on GitHub:*
1498 :issue:`8271`.
1499
1500
1501
1502 - Fixed ``multipart/form-data`` compliance with :rfc:`7578` -- by :user:`Dreamsorcerer`.
1503
1504
1505 *Related issues and pull requests on GitHub:*
1506 :issue:`8280`.
1507
1508
1509
1510 - Fixed blocking I/O in the event loop while processing files in a POST request
1511 -- by :user:`bdraco`.
1512
1513
1514 *Related issues and pull requests on GitHub:*
1515 :issue:`8283`.
1516
1517
1518
1519 - Escaped filenames in static view -- by :user:`bdraco`.
1520
1521
1522 *Related issues and pull requests on GitHub:*
1523 :issue:`8317`.
1524
1525
1526
1527 - Fixed the pure python parser to mark a connection as closing when a
1528 response has no length -- by :user:`Dreamsorcerer`.
1529
1530
1531 *Related issues and pull requests on GitHub:*
1532 :issue:`8320`.
1533
1534
1535
1536
1537 Features
1538 --------
1539
1540 - Upgraded *llhttp* to 9.2.1, and started rejecting obsolete line folding
1541 in Python parser to match -- by :user:`Dreamsorcerer`.
1542
1543
1544 *Related issues and pull requests on GitHub:*
1545 :issue:`8146`, :issue:`8292`.
1546
1547
1548
1549
1550 Deprecations (removal in next major release)
1551 --------------------------------------------
1552
1553 - Deprecated ``content_transfer_encoding`` parameter in :py:meth:`FormData.add_field()
1554 <aiohttp.FormData.add_field>` -- by :user:`Dreamsorcerer`.
1555
1556
1557 *Related issues and pull requests on GitHub:*
1558 :issue:`8280`.
1559
1560
1561
1562
1563 Improved documentation
1564 ----------------------
1565
1566 - Added a note about canceling tasks to avoid delaying server shutdown -- by :user:`Dreamsorcerer`.
1567
1568
1569 *Related issues and pull requests on GitHub:*
1570 :issue:`8267`.
1571
1572
1573
1574
1575 Contributor-facing changes
1576 --------------------------
1577
1578 - The pull request template is now asking the contributors to
1579 answer a question about the long-term maintenance challenges
1580 they envision as a result of merging their patches
1581 -- by :user:`webknjaz`.
1582
1583
1584 *Related issues and pull requests on GitHub:*
1585 :issue:`8099`.
1586
1587
1588
1589 - Updated CI and documentation to use NPM clean install and upgrade
1590 node to version 18 -- by :user:`steverep`.
1591
1592
1593 *Related issues and pull requests on GitHub:*
1594 :issue:`8116`.
1595
1596
1597
1598 - A pytest fixture ``hello_txt`` was introduced to aid
1599 static file serving tests in
1600 :file:`test_web_sendfile_functional.py`. It dynamically
1601 provisions ``hello.txt`` file variants shared across the
1602 tests in the module.
1603
1604 -- by :user:`steverep`
1605
1606
1607 *Related issues and pull requests on GitHub:*
1608 :issue:`8136`.
1609
1610
1611
1612
1613 Packaging updates and notes for downstreams
1614 -------------------------------------------
1615
1616 - Added an ``internal`` pytest marker for tests which should be skipped
1617 by packagers (use ``-m 'not internal'`` to disable them) -- by :user:`Dreamsorcerer`.
1618
1619
1620 *Related issues and pull requests on GitHub:*
1621 :issue:`8299`.
1622
1623
1624
1625
1626 ----
1627
1628
1629 3.9.3 (2024-01-29)
1630 ==================
1631
1632 Bug fixes
1633 ---------
1634
1635 - Fixed backwards compatibility breakage (in 3.9.2) of ``ssl`` parameter when set outside
1636 of ``ClientSession`` (e.g. directly in ``TCPConnector``) -- by :user:`Dreamsorcerer`.
1637
1638
1639 *Related issues and pull requests on GitHub:*
1640 :issue:`8097`, :issue:`8098`.
1641
1642
1643
1644
1645 Miscellaneous internal changes
1646 ------------------------------
1647
1648 - Improved test suite handling of paths and temp files to consistently use pathlib and pytest fixtures.
1649
1650
1651 *Related issues and pull requests on GitHub:*
1652 :issue:`3957`.
1653
1654
1655
1656
1657 ----
1658
1659
1660 3.9.2 (2024-01-28)
1661 ==================
1662
1663 Bug fixes
1664 ---------
1665
1666 - Fixed server-side websocket connection leak.
1667
1668
1669 *Related issues and pull requests on GitHub:*
1670 :issue:`7978`.
1671
1672
1673
1674 - Fixed ``web.FileResponse`` doing blocking I/O in the event loop.
1675
1676
1677 *Related issues and pull requests on GitHub:*
1678 :issue:`8012`.
1679
1680
1681
1682 - Fixed double compress when compression enabled and compressed file exists in server file responses.
1683
1684
1685 *Related issues and pull requests on GitHub:*
1686 :issue:`8014`.
1687
1688
1689
1690 - Added runtime type check for ``ClientSession`` ``timeout`` parameter.
1691
1692
1693 *Related issues and pull requests on GitHub:*
1694 :issue:`8021`.
1695
1696
1697
1698 - Fixed an unhandled exception in the Python HTTP parser on header lines starting with a colon -- by :user:`pajod`.
1699
1700 Invalid request lines with anything but a dot between the HTTP major and minor version are now rejected.
1701 Invalid header field names containing question mark or slash are now rejected.
1702 Such requests are incompatible with :rfc:`9110#section-5.6.2` and are not known to be of any legitimate use.
1703
1704
1705 *Related issues and pull requests on GitHub:*
1706 :issue:`8074`.
1707
1708
1709
1710 - Improved validation of paths for static resources requests to the server -- by :user:`bdraco`.
1711
1712
1713 *Related issues and pull requests on GitHub:*
1714 :issue:`8079`.
1715
1716
1717
1718
1719 Features
1720 --------
1721
1722 - Added support for passing :py:data:`True` to ``ssl`` parameter in ``ClientSession`` while
1723 deprecating :py:data:`None` -- by :user:`xiangyan99`.
1724
1725
1726 *Related issues and pull requests on GitHub:*
1727 :issue:`7698`.
1728
1729
1730
1731 Breaking changes
1732 ----------------
1733
1734 - Fixed an unhandled exception in the Python HTTP parser on header lines starting with a colon -- by :user:`pajod`.
1735
1736 Invalid request lines with anything but a dot between the HTTP major and minor version are now rejected.
1737 Invalid header field names containing question mark or slash are now rejected.
1738 Such requests are incompatible with :rfc:`9110#section-5.6.2` and are not known to be of any legitimate use.
1739
1740
1741 *Related issues and pull requests on GitHub:*
1742 :issue:`8074`.
1743
1744
1745
1746
1747 Improved documentation
1748 ----------------------
1749
1750 - Fixed examples of ``fallback_charset_resolver`` function in the :doc:`client_advanced` document. -- by :user:`henry0312`.
1751
1752
1753 *Related issues and pull requests on GitHub:*
1754 :issue:`7995`.
1755
1756
1757
1758 - The Sphinx setup was updated to avoid showing the empty
1759 changelog draft section in the tagged release documentation
1760 builds on Read The Docs -- by :user:`webknjaz`.
1761
1762
1763 *Related issues and pull requests on GitHub:*
1764 :issue:`8067`.
1765
1766
1767
1768
1769 Packaging updates and notes for downstreams
1770 -------------------------------------------
1771
1772 - The changelog categorization was made clearer. The
1773 contributors can now mark their fragment files more
1774 accurately -- by :user:`webknjaz`.
1775
1776 The new category tags are:
1777
1778 * ``bugfix``
1779
1780 * ``feature``
1781
1782 * ``deprecation``
1783
1784 * ``breaking`` (previously, ``removal``)
1785
1786 * ``doc``
1787
1788 * ``packaging``
1789
1790 * ``contrib``
1791
1792 * ``misc``
1793
1794
1795 *Related issues and pull requests on GitHub:*
1796 :issue:`8066`.
1797
1798
1799
1800
1801 Contributor-facing changes
1802 --------------------------
1803
1804 - Updated :ref:`contributing/Tests coverage <aiohttp-contributing>` section to show how we use ``codecov`` -- by :user:`Dreamsorcerer`.
1805
1806
1807 *Related issues and pull requests on GitHub:*
1808 :issue:`7916`.
1809
1810
1811
1812 - The changelog categorization was made clearer. The
1813 contributors can now mark their fragment files more
1814 accurately -- by :user:`webknjaz`.
1815
1816 The new category tags are:
1817
1818 * ``bugfix``
1819
1820 * ``feature``
1821
1822 * ``deprecation``
1823
1824 * ``breaking`` (previously, ``removal``)
1825
1826 * ``doc``
1827
1828 * ``packaging``
1829
1830 * ``contrib``
1831
1832 * ``misc``
1833
1834
1835 *Related issues and pull requests on GitHub:*
1836 :issue:`8066`.
1837
1838
1839
1840
1841 Miscellaneous internal changes
1842 ------------------------------
1843
1844 - Replaced all ``tmpdir`` fixtures with ``tmp_path`` in test suite.
1845
1846
1847 *Related issues and pull requests on GitHub:*
1848 :issue:`3551`.
1849
1850
1851
1852
1853 ----
1854
1855
1856 3.9.1 (2023-11-26)
1857 ==================
1858
1859 Bugfixes
1860 --------
1861
1862 - Fixed importing aiohttp under PyPy on Windows.
1863
1864 `#7848 <https://github.com/aio-libs/aiohttp/issues/7848>`_
1865
1866 - Fixed async concurrency safety in websocket compressor.
1867
1868 `#7865 <https://github.com/aio-libs/aiohttp/issues/7865>`_
1869
1870 - Fixed ``ClientResponse.close()`` releasing the connection instead of closing.
1871
1872 `#7869 <https://github.com/aio-libs/aiohttp/issues/7869>`_
1873
1874 - Fixed a regression where connection may get closed during upgrade. -- by :user:`Dreamsorcerer`
1875
1876 `#7879 <https://github.com/aio-libs/aiohttp/issues/7879>`_
1877
1878 - Fixed messages being reported as upgraded without an Upgrade header in Python parser. -- by :user:`Dreamsorcerer`
1879
1880 `#7895 <https://github.com/aio-libs/aiohttp/issues/7895>`_
1881
1882
1883
1884 ----
1885
1886
1887 3.9.0 (2023-11-18)
1888 ==================
1889
1890 Features
1891 --------
1892
1893 - Introduced ``AppKey`` for static typing support of ``Application`` storage.
1894 See https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
1895
1896 `#5864 <https://github.com/aio-libs/aiohttp/issues/5864>`_
1897
1898 - Added a graceful shutdown period which allows pending tasks to complete before the application's cleanup is called.
1899 The period can be adjusted with the ``shutdown_timeout`` parameter. -- by :user:`Dreamsorcerer`.
1900 See https://docs.aiohttp.org/en/latest/web_advanced.html#graceful-shutdown
1901
1902 `#7188 <https://github.com/aio-libs/aiohttp/issues/7188>`_
1903
1904 - Added `handler_cancellation <https://docs.aiohttp.org/en/stable/web_advanced.html#web-handler-cancellation>`_ parameter to cancel web handler on client disconnection. -- by :user:`mosquito`
1905 This (optionally) reintroduces a feature removed in a previous release.
1906 Recommended for those looking for an extra level of protection against denial-of-service attacks.
1907
1908 `#7056 <https://github.com/aio-libs/aiohttp/issues/7056>`_
1909
1910 - Added support for setting response header parameters ``max_line_size`` and ``max_field_size``.
1911
1912 `#2304 <https://github.com/aio-libs/aiohttp/issues/2304>`_
1913
1914 - Added ``auto_decompress`` parameter to ``ClientSession.request`` to override ``ClientSession._auto_decompress``. -- by :user:`Daste745`
1915
1916 `#3751 <https://github.com/aio-libs/aiohttp/issues/3751>`_
1917
1918 - Changed ``raise_for_status`` to allow a coroutine.
1919
1920 `#3892 <https://github.com/aio-libs/aiohttp/issues/3892>`_
1921
1922 - Added client brotli compression support (optional with runtime check).
1923
1924 `#5219 <https://github.com/aio-libs/aiohttp/issues/5219>`_
1925
1926 - Added ``client_max_size`` to ``BaseRequest.clone()`` to allow overriding the request body size. -- :user:`anesabml`.
1927
1928 `#5704 <https://github.com/aio-libs/aiohttp/issues/5704>`_
1929
1930 - Added a middleware type alias ``aiohttp.typedefs.Middleware``.
1931
1932 `#5898 <https://github.com/aio-libs/aiohttp/issues/5898>`_
1933
1934 - Exported ``HTTPMove`` which can be used to catch any redirection request
1935 that has a location -- :user:`dreamsorcerer`.
1936
1937 `#6594 <https://github.com/aio-libs/aiohttp/issues/6594>`_
1938
1939 - Changed the ``path`` parameter in ``web.run_app()`` to accept a ``pathlib.Path`` object.
1940
1941 `#6839 <https://github.com/aio-libs/aiohttp/issues/6839>`_
1942
1943 - Performance: Skipped filtering ``CookieJar`` when the jar is empty or all cookies have expired.
1944
1945 `#7819 <https://github.com/aio-libs/aiohttp/issues/7819>`_
1946
1947 - Performance: Only check origin if insecure scheme and there are origins to treat as secure, in ``CookieJar.filter_cookies()``.
1948
1949 `#7821 <https://github.com/aio-libs/aiohttp/issues/7821>`_
1950
1951 - Performance: Used timestamp instead of ``datetime`` to achieve faster cookie expiration in ``CookieJar``.
1952
1953 `#7824 <https://github.com/aio-libs/aiohttp/issues/7824>`_
1954
1955 - Added support for passing a custom server name parameter to HTTPS connection.
1956
1957 `#7114 <https://github.com/aio-libs/aiohttp/issues/7114>`_
1958
1959 - Added support for using Basic Auth credentials from :file:`.netrc` file when making HTTP requests with the
1960 :py:class:`~aiohttp.ClientSession` ``trust_env`` argument is set to ``True``. -- by :user:`yuvipanda`.
1961
1962 `#7131 <https://github.com/aio-libs/aiohttp/issues/7131>`_
1963
1964 - Turned access log into no-op when the logger is disabled.
1965
1966 `#7240 <https://github.com/aio-libs/aiohttp/issues/7240>`_
1967
1968 - Added typing information to ``RawResponseMessage``. -- by :user:`Gobot1234`
1969
1970 `#7365 <https://github.com/aio-libs/aiohttp/issues/7365>`_
1971
1972 - Removed ``async-timeout`` for Python 3.11+ (replaced with ``asyncio.timeout()`` on newer releases).
1973
1974 `#7502 <https://github.com/aio-libs/aiohttp/issues/7502>`_
1975
1976 - Added support for ``brotlicffi`` as an alternative to ``brotli`` (fixing Brotli support on PyPy).
1977
1978 `#7611 <https://github.com/aio-libs/aiohttp/issues/7611>`_
1979
1980 - Added ``WebSocketResponse.get_extra_info()`` to access a protocol transport's extra info.
1981
1982 `#7078 <https://github.com/aio-libs/aiohttp/issues/7078>`_
1983
1984 - Allow ``link`` argument to be set to None/empty in HTTP 451 exception.
1985
1986 `#7689 <https://github.com/aio-libs/aiohttp/issues/7689>`_
1987
1988
1989
1990 Bugfixes
1991 --------
1992
1993 - Implemented stripping the trailing dots from fully-qualified domain names in ``Host`` headers and TLS context when acting as an HTTP client.
1994 This allows the client to connect to URLs with FQDN host name like ``https://example.com./``.
1995 -- by :user:`martin-sucha`.
1996
1997 `#3636 <https://github.com/aio-libs/aiohttp/issues/3636>`_
1998
1999 - Fixed client timeout not working when incoming data is always available without waiting. -- by :user:`Dreamsorcerer`.
2000
2001 `#5854 <https://github.com/aio-libs/aiohttp/issues/5854>`_
2002
2003 - Fixed ``readuntil`` to work with a delimiter of more than one character.
2004
2005 `#6701 <https://github.com/aio-libs/aiohttp/issues/6701>`_
2006
2007 - Added ``__repr__`` to ``EmptyStreamReader`` to avoid ``AttributeError``.
2008
2009 `#6916 <https://github.com/aio-libs/aiohttp/issues/6916>`_
2010
2011 - Fixed bug when using ``TCPConnector`` with ``ttl_dns_cache=0``.
2012
2013 `#7014 <https://github.com/aio-libs/aiohttp/issues/7014>`_
2014
2015 - Fixed response returned from expect handler being thrown away. -- by :user:`Dreamsorcerer`
2016
2017 `#7025 <https://github.com/aio-libs/aiohttp/issues/7025>`_
2018
2019 - Avoided raising ``UnicodeDecodeError`` in multipart and in HTTP headers parsing.
2020
2021 `#7044 <https://github.com/aio-libs/aiohttp/issues/7044>`_
2022
2023 - Changed ``sock_read`` timeout to start after writing has finished, avoiding read timeouts caused by an unfinished write. -- by :user:`dtrifiro`
2024
2025 `#7149 <https://github.com/aio-libs/aiohttp/issues/7149>`_
2026
2027 - Fixed missing query in tracing method URLs when using ``yarl`` 1.9+.
2028
2029 `#7259 <https://github.com/aio-libs/aiohttp/issues/7259>`_
2030
2031 - 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.
2032
2033 `#7302 <https://github.com/aio-libs/aiohttp/issues/7302>`_
2034
2035 - Fixed ``EmptyStreamReader.iter_chunks()`` never ending. -- by :user:`mind1m`
2036
2037 `#7616 <https://github.com/aio-libs/aiohttp/issues/7616>`_
2038
2039 - Fixed a rare ``RuntimeError: await wasn't used with future`` exception. -- by :user:`stalkerg`
2040
2041 `#7785 <https://github.com/aio-libs/aiohttp/issues/7785>`_
2042
2043 - Fixed issue with insufficient HTTP method and version validation.
2044
2045 `#7700 <https://github.com/aio-libs/aiohttp/issues/7700>`_
2046
2047 - Added check to validate that absolute URIs have schemes.
2048
2049 `#7712 <https://github.com/aio-libs/aiohttp/issues/7712>`_
2050
2051 - Fixed unhandled exception when Python HTTP parser encounters unpaired Unicode surrogates.
2052
2053 `#7715 <https://github.com/aio-libs/aiohttp/issues/7715>`_
2054
2055 - Updated parser to disallow invalid characters in header field names and stop accepting LF as a request line separator.
2056
2057 `#7719 <https://github.com/aio-libs/aiohttp/issues/7719>`_
2058
2059 - Fixed Python HTTP parser not treating 204/304/1xx as an empty body.
2060
2061 `#7755 <https://github.com/aio-libs/aiohttp/issues/7755>`_
2062
2063 - Ensure empty body response for 1xx/204/304 per RFC 9112 sec 6.3.
2064
2065 `#7756 <https://github.com/aio-libs/aiohttp/issues/7756>`_
2066
2067 - Fixed an issue when a client request is closed before completing a chunked payload. -- by :user:`Dreamsorcerer`
2068
2069 `#7764 <https://github.com/aio-libs/aiohttp/issues/7764>`_
2070
2071 - Edge Case Handling for ResponseParser for missing reason value.
2072
2073 `#7776 <https://github.com/aio-libs/aiohttp/issues/7776>`_
2074
2075 - Fixed ``ClientWebSocketResponse.close_code`` being erroneously set to ``None`` when there are concurrent async tasks receiving data and closing the connection.
2076
2077 `#7306 <https://github.com/aio-libs/aiohttp/issues/7306>`_
2078
2079 - Added HTTP method validation.
2080
2081 `#6533 <https://github.com/aio-libs/aiohttp/issues/6533>`_
2082
2083 - Fixed arbitrary sequence types being allowed to inject values via version parameter. -- by :user:`Dreamsorcerer`
2084
2085 `#7835 <https://github.com/aio-libs/aiohttp/issues/7835>`_
2086
2087 - Performance: Fixed increase in latency with small messages from websocket compression changes.
2088
2089 `#7797 <https://github.com/aio-libs/aiohttp/issues/7797>`_
2090
2091
2092
2093 Improved Documentation
2094 ----------------------
2095
2096 - Fixed the `ClientResponse.release`'s type in the doc. Changed from `comethod` to `method`.
2097
2098 `#5836 <https://github.com/aio-libs/aiohttp/issues/5836>`_
2099
2100 - Added information on behavior of base_url parameter in `ClientSession`.
2101
2102 `#6647 <https://github.com/aio-libs/aiohttp/issues/6647>`_
2103
2104 - Fixed `ClientResponseError` docs.
2105
2106 `#6700 <https://github.com/aio-libs/aiohttp/issues/6700>`_
2107
2108 - Updated Redis code examples to follow the latest API.
2109
2110 `#6907 <https://github.com/aio-libs/aiohttp/issues/6907>`_
2111
2112 - Added a note about possibly needing to update headers when using ``on_response_prepare``. -- by :user:`Dreamsorcerer`
2113
2114 `#7283 <https://github.com/aio-libs/aiohttp/issues/7283>`_
2115
2116 - Completed ``trust_env`` parameter description to honor ``wss_proxy``, ``ws_proxy`` or ``no_proxy`` env.
2117
2118 `#7325 <https://github.com/aio-libs/aiohttp/issues/7325>`_
2119
2120 - Expanded SSL documentation with more examples (e.g. how to use certifi). -- by :user:`Dreamsorcerer`
2121
2122 `#7334 <https://github.com/aio-libs/aiohttp/issues/7334>`_
2123
2124 - Fix, update, and improve client exceptions documentation.
2125
2126 `#7733 <https://github.com/aio-libs/aiohttp/issues/7733>`_
2127
2128
2129
2130 Deprecations and Removals
2131 -------------------------
2132
2133 - Added ``shutdown_timeout`` parameter to ``BaseRunner``, while
2134 deprecating ``shutdown_timeout`` parameter from ``BaseSite``. -- by :user:`Dreamsorcerer`
2135
2136 `#7718 <https://github.com/aio-libs/aiohttp/issues/7718>`_
2137
2138 - Dropped Python 3.6 support.
2139
2140 `#6378 <https://github.com/aio-libs/aiohttp/issues/6378>`_
2141
2142 - Dropped Python 3.7 support. -- by :user:`Dreamsorcerer`
2143
2144 `#7336 <https://github.com/aio-libs/aiohttp/issues/7336>`_
2145
2146 - Removed support for abandoned ``tokio`` event loop. -- by :user:`Dreamsorcerer`
2147
2148 `#7281 <https://github.com/aio-libs/aiohttp/issues/7281>`_
2149
2150
2151
2152 Misc
2153 ----
2154
2155 - Made ``print`` argument in ``run_app()`` optional.
2156
2157 `#3690 <https://github.com/aio-libs/aiohttp/issues/3690>`_
2158
2159 - Improved performance of ``ceil_timeout`` in some cases.
2160
2161 `#6316 <https://github.com/aio-libs/aiohttp/issues/6316>`_
2162
2163 - Changed importing Gunicorn to happen on-demand, decreasing import time by ~53%. -- :user:`Dreamsorcerer`
2164
2165 `#6591 <https://github.com/aio-libs/aiohttp/issues/6591>`_
2166
2167 - Improved import time by replacing ``http.server`` with ``http.HTTPStatus``.
2168
2169 `#6903 <https://github.com/aio-libs/aiohttp/issues/6903>`_
2170
2171 - Fixed annotation of ``ssl`` parameter to disallow ``True``. -- by :user:`Dreamsorcerer`.
2172
2173 `#7335 <https://github.com/aio-libs/aiohttp/issues/7335>`_
2174
2175
2176 ----
2177
2178
2179 3.8.6 (2023-10-07)
2180 ==================
2181
2182 Security bugfixes
2183 -----------------
2184
2185 - Upgraded the vendored copy of llhttp_ to v9.1.3 -- by :user:`Dreamsorcerer`
2186
2187 Thanks to :user:`kenballus` for reporting this, see
2188 https://github.com/aio-libs/aiohttp/security/advisories/GHSA-pjjw-qhg8-p2p9.
2189
2190 .. _llhttp: https://llhttp.org
2191
2192 `#7647 <https://github.com/aio-libs/aiohttp/issues/7647>`_
2193
2194 - Updated Python parser to comply with RFCs 9110/9112 -- by :user:`Dreamorcerer`
2195
2196 Thanks to :user:`kenballus` for reporting this, see
2197 https://github.com/aio-libs/aiohttp/security/advisories/GHSA-gfw2-4jvh-wgfg.
2198
2199 `#7663 <https://github.com/aio-libs/aiohttp/issues/7663>`_
2200
2201
2202 Deprecation
2203 -----------
2204
2205 - Added ``fallback_charset_resolver`` parameter in ``ClientSession`` to allow a user-supplied
2206 character set detection function.
2207
2208 Character set detection will no longer be included in 3.9 as a default. If this feature is needed,
2209 please use `fallback_charset_resolver <https://docs.aiohttp.org/en/stable/client_advanced.html#character-set-detection>`_.
2210
2211 `#7561 <https://github.com/aio-libs/aiohttp/issues/7561>`_
2212
2213
2214 Features
2215 --------
2216
2217 - Enabled lenient response parsing for more flexible parsing in the client
2218 (this should resolve some regressions when dealing with badly formatted HTTP responses). -- by :user:`Dreamsorcerer`
2219
2220 `#7490 <https://github.com/aio-libs/aiohttp/issues/7490>`_
2221
2222
2223
2224 Bugfixes
2225 --------
2226
2227 - Fixed ``PermissionError`` when ``.netrc`` is unreadable due to permissions.
2228
2229 `#7237 <https://github.com/aio-libs/aiohttp/issues/7237>`_
2230
2231 - Fixed output of parsing errors pointing to a ``\n``. -- by :user:`Dreamsorcerer`
2232
2233 `#7468 <https://github.com/aio-libs/aiohttp/issues/7468>`_
2234
2235 - Fixed ``GunicornWebWorker`` max_requests_jitter not working.
2236
2237 `#7518 <https://github.com/aio-libs/aiohttp/issues/7518>`_
2238
2239 - Fixed sorting in ``filter_cookies`` to use cookie with longest path. -- by :user:`marq24`.
2240
2241 `#7577 <https://github.com/aio-libs/aiohttp/issues/7577>`_
2242
2243 - Fixed display of ``BadStatusLine`` messages from llhttp_. -- by :user:`Dreamsorcerer`
2244
2245 `#7651 <https://github.com/aio-libs/aiohttp/issues/7651>`_
2246
2247
2248 ----
2249
2250
2251 3.8.5 (2023-07-19)
2252 ==================
2253
2254 Security bugfixes
2255 -----------------
2256
2257 - Upgraded the vendored copy of llhttp_ to v8.1.1 -- by :user:`webknjaz`
2258 and :user:`Dreamsorcerer`.
2259
2260 Thanks to :user:`sethmlarson` for reporting this and providing us with
2261 comprehensive reproducer, workarounds and fixing details! For more
2262 information, see
2263 https://github.com/aio-libs/aiohttp/security/advisories/GHSA-45c4-8wx5-qw6w.
2264
2265 .. _llhttp: https://llhttp.org
2266
2267 `#7346 <https://github.com/aio-libs/aiohttp/issues/7346>`_
2268
2269
2270 Features
2271 --------
2272
2273 - Added information to C parser exceptions to show which character caused the error. -- by :user:`Dreamsorcerer`
2274
2275 `#7366 <https://github.com/aio-libs/aiohttp/issues/7366>`_
2276
2277
2278 Bugfixes
2279 --------
2280
2281 - Fixed a transport is :data:`None` error -- by :user:`Dreamsorcerer`.
2282
2283 `#3355 <https://github.com/aio-libs/aiohttp/issues/3355>`_
2284
2285
2286 ----
2287
2288
2289 3.8.4 (2023-02-12)
2290 ==================
2291
2292 Bugfixes
2293 --------
2294
2295 - Fixed incorrectly overwriting cookies with the same name and domain, but different path.
2296 `#6638 <https://github.com/aio-libs/aiohttp/issues/6638>`_
2297 - Fixed ``ConnectionResetError`` not being raised after client disconnection in SSL environments.
2298 `#7180 <https://github.com/aio-libs/aiohttp/issues/7180>`_
2299
2300
2301 ----
2302
2303
2304 3.8.3 (2022-09-21)
2305 ==================
2306
2307 .. attention::
2308
2309 This is the last :doc:`aiohttp <index>` release tested under
2310 Python 3.6. The 3.9 stream is dropping it from the CI and the
2311 distribution package metadata.
2312
2313 Bugfixes
2314 --------
2315
2316 - Increased the upper boundary of the :doc:`multidict:index` dependency
2317 to allow for the version 6 -- by :user:`hugovk`.
2318
2319 It used to be limited below version 7 in :doc:`aiohttp <index>` v3.8.1 but
2320 was lowered in v3.8.2 via :pr:`6550` and never brought back, causing
2321 problems with dependency pins when upgrading. :doc:`aiohttp <index>` v3.8.3
2322 fixes that by recovering the original boundary of ``< 7``.
2323 `#6950 <https://github.com/aio-libs/aiohttp/issues/6950>`_
2324
2325
2326 ----
2327
2328
2329 3.8.2 (2022-09-20, subsequently yanked on 2022-09-21)
2330 =====================================================
2331
2332 Bugfixes
2333 --------
2334
2335 - Support registering OPTIONS HTTP method handlers via RouteTableDef.
2336 `#4663 <https://github.com/aio-libs/aiohttp/issues/4663>`_
2337 - Started supporting ``authority-form`` and ``absolute-form`` URLs on the server-side.
2338 `#6227 <https://github.com/aio-libs/aiohttp/issues/6227>`_
2339 - Fix Python 3.11 alpha incompatibilities by using Cython 0.29.25
2340 `#6396 <https://github.com/aio-libs/aiohttp/issues/6396>`_
2341 - Remove a deprecated usage of pytest.warns(None)
2342 `#6663 <https://github.com/aio-libs/aiohttp/issues/6663>`_
2343 - Fix regression where ``asyncio.CancelledError`` occurs on client disconnection.
2344 `#6719 <https://github.com/aio-libs/aiohttp/issues/6719>`_
2345 - Export :py:class:`~aiohttp.web.PrefixedSubAppResource` under
2346 :py:mod:`aiohttp.web` -- by :user:`Dreamsorcerer`.
2347
2348 This fixes a regression introduced by :pr:`3469`.
2349 `#6889 <https://github.com/aio-libs/aiohttp/issues/6889>`_
2350 - Dropped the :class:`object` type possibility from
2351 the :py:attr:`aiohttp.ClientSession.timeout`
2352 property return type declaration.
2353 `#6917 <https://github.com/aio-libs/aiohttp/issues/6917>`_,
2354 `#6923 <https://github.com/aio-libs/aiohttp/issues/6923>`_
2355
2356
2357 Improved Documentation
2358 ----------------------
2359
2360 - Added clarification on configuring the app object with settings such as a db connection.
2361 `#4137 <https://github.com/aio-libs/aiohttp/issues/4137>`_
2362 - Edited the web.run_app declaration.
2363 `#6401 <https://github.com/aio-libs/aiohttp/issues/6401>`_
2364 - Dropped the :class:`object` type possibility from
2365 the :py:attr:`aiohttp.ClientSession.timeout`
2366 property return type declaration.
2367 `#6917 <https://github.com/aio-libs/aiohttp/issues/6917>`_,
2368 `#6923 <https://github.com/aio-libs/aiohttp/issues/6923>`_
2369
2370
2371 Deprecations and Removals
2372 -------------------------
2373
2374 - Drop Python 3.5 support, aiohttp works on 3.6+ now.
2375 `#4046 <https://github.com/aio-libs/aiohttp/issues/4046>`_
2376
2377
2378 Misc
2379 ----
2380
2381 - `#6369 <https://github.com/aio-libs/aiohttp/issues/6369>`_, `#6399 <https://github.com/aio-libs/aiohttp/issues/6399>`_, `#6550 <https://github.com/aio-libs/aiohttp/issues/6550>`_, `#6708 <https://github.com/aio-libs/aiohttp/issues/6708>`_, `#6757 <https://github.com/aio-libs/aiohttp/issues/6757>`_, `#6857 <https://github.com/aio-libs/aiohttp/issues/6857>`_, `#6872 <https://github.com/aio-libs/aiohttp/issues/6872>`_
2382
2383
2384 ----
2385
2386
2387 3.8.1 (2021-11-14)
2388 ==================
2389
2390 Bugfixes
2391 --------
2392
2393 - Fix the error in handling the return value of `getaddrinfo`.
2394 `getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family.
2395 It will cause a index out of range error in aiohttp. For example, if user compile CPython with
2396 `--disable-ipv6` option but his system enable the ipv6.
2397 `#5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_
2398 - Do not install "examples" as a top-level package.
2399 `#6189 <https://github.com/aio-libs/aiohttp/issues/6189>`_
2400 - Restored ability to connect IPv6-only host.
2401 `#6195 <https://github.com/aio-libs/aiohttp/issues/6195>`_
2402 - Remove ``Signal`` from ``__all__``, replace ``aiohttp.Signal`` with ``aiosignal.Signal`` in docs
2403 `#6201 <https://github.com/aio-libs/aiohttp/issues/6201>`_
2404 - Made chunked encoding HTTP header check stricter.
2405 `#6305 <https://github.com/aio-libs/aiohttp/issues/6305>`_
2406
2407
2408 Improved Documentation
2409 ----------------------
2410
2411 - update quick starter demo codes.
2412 `#6240 <https://github.com/aio-libs/aiohttp/issues/6240>`_
2413 - Added an explanation of how tiny timeouts affect performance to the client reference document.
2414 `#6274 <https://github.com/aio-libs/aiohttp/issues/6274>`_
2415 - Add flake8-docstrings to flake8 configuration, enable subset of checks.
2416 `#6276 <https://github.com/aio-libs/aiohttp/issues/6276>`_
2417 - Added information on running complex applications with additional tasks/processes -- :user:`Dreamsorcerer`.
2418 `#6278 <https://github.com/aio-libs/aiohttp/issues/6278>`_
2419
2420
2421 Misc
2422 ----
2423
2424 - `#6205 <https://github.com/aio-libs/aiohttp/issues/6205>`_
2425
2426
2427 ----
2428
2429
2430 3.8.0 (2021-10-31)
2431 ==================
2432
2433 Features
2434 --------
2435
2436 - Added a ``GunicornWebWorker`` feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return ``web.AppRunner`` object.
2437 `#2988 <https://github.com/aio-libs/aiohttp/issues/2988>`_
2438 - Switch from ``http-parser`` to ``llhttp``
2439 `#3561 <https://github.com/aio-libs/aiohttp/issues/3561>`_
2440 - Use Brotli instead of brotlipy
2441 `#3803 <https://github.com/aio-libs/aiohttp/issues/3803>`_
2442 - Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp
2443 cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly
2444 disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python
2445 mode is significantly slower than compiled one.
2446 `#3828 <https://github.com/aio-libs/aiohttp/issues/3828>`_
2447 - Make access log use local time with timezone
2448 `#3853 <https://github.com/aio-libs/aiohttp/issues/3853>`_
2449 - Implemented ``readuntil`` in ``StreamResponse``
2450 `#4054 <https://github.com/aio-libs/aiohttp/issues/4054>`_
2451 - FileResponse now supports ETag.
2452 `#4594 <https://github.com/aio-libs/aiohttp/issues/4594>`_
2453 - Add a request handler type alias ``aiohttp.typedefs.Handler``.
2454 `#4686 <https://github.com/aio-libs/aiohttp/issues/4686>`_
2455 - ``AioHTTPTestCase`` is more async friendly now.
2456
2457 For people who use unittest and are used to use :py:exc:`~unittest.TestCase`
2458 it will be easier to write new test cases like the sync version of the :py:exc:`~unittest.TestCase` class,
2459 without using the decorator `@unittest_run_loop`, just `async def test_*`.
2460 The only difference is that for the people using python3.7 and below a new dependency is needed, it is ``asynctestcase``.
2461 `#4700 <https://github.com/aio-libs/aiohttp/issues/4700>`_
2462 - Add validation of HTTP header keys and values to prevent header injection.
2463 `#4818 <https://github.com/aio-libs/aiohttp/issues/4818>`_
2464 - Add predicate to ``AbstractCookieJar.clear``.
2465 Add ``AbstractCookieJar.clear_domain`` to clean all domain and subdomains cookies only.
2466 `#4942 <https://github.com/aio-libs/aiohttp/issues/4942>`_
2467 - Add keepalive_timeout parameter to web.run_app.
2468 `#5094 <https://github.com/aio-libs/aiohttp/issues/5094>`_
2469 - Tracing for client sent headers
2470 `#5105 <https://github.com/aio-libs/aiohttp/issues/5105>`_
2471 - Make type hints for http parser stricter
2472 `#5267 <https://github.com/aio-libs/aiohttp/issues/5267>`_
2473 - Add final declarations for constants.
2474 `#5275 <https://github.com/aio-libs/aiohttp/issues/5275>`_
2475 - Switch to external frozenlist and aiosignal libraries.
2476 `#5293 <https://github.com/aio-libs/aiohttp/issues/5293>`_
2477 - Don't send secure cookies by insecure transports.
2478
2479 By default, the transport is secure if https or wss scheme is used.
2480 Use `CookieJar(treat_as_secure_origin="http://127.0.0.1")` to override the default security checker.
2481 `#5571 <https://github.com/aio-libs/aiohttp/issues/5571>`_
2482 - Always create a new event loop in ``aiohttp.web.run_app()``.
2483 This adds better compatibility with ``asyncio.run()`` or if trying to run multiple apps in sequence.
2484 `#5572 <https://github.com/aio-libs/aiohttp/issues/5572>`_
2485 - Add ``aiohttp.pytest_plugin.AiohttpClient`` for static typing of pytest plugin.
2486 `#5585 <https://github.com/aio-libs/aiohttp/issues/5585>`_
2487 - Added a ``socket_factory`` argument to ``BaseTestServer``.
2488 `#5844 <https://github.com/aio-libs/aiohttp/issues/5844>`_
2489 - Add compression strategy parameter to enable_compression method.
2490 `#5909 <https://github.com/aio-libs/aiohttp/issues/5909>`_
2491 - Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- :user:`Hanaasagi`.
2492 `#5927 <https://github.com/aio-libs/aiohttp/issues/5927>`_
2493 - Switched ``chardet`` to ``charset-normalizer`` for guessing the HTTP payload body encoding -- :user:`Ousret`.
2494 `#5930 <https://github.com/aio-libs/aiohttp/issues/5930>`_
2495 - Added optional auto_decompress argument for HttpRequestParser
2496 `#5957 <https://github.com/aio-libs/aiohttp/issues/5957>`_
2497 - Added support for HTTPS proxies to the extent CPython's
2498 :py:mod:`asyncio` supports it -- by :user:`bmbouter`,
2499 :user:`jborean93` and :user:`webknjaz`.
2500 `#5992 <https://github.com/aio-libs/aiohttp/issues/5992>`_
2501 - Added ``base_url`` parameter to the initializer of :class:`~aiohttp.ClientSession`.
2502 `#6013 <https://github.com/aio-libs/aiohttp/issues/6013>`_
2503 - Add Trove classifier and create binary wheels for 3.10. -- :user:`hugovk`.
2504 `#6079 <https://github.com/aio-libs/aiohttp/issues/6079>`_
2505 - Started shipping platform-specific wheels with the ``musl`` tag targeting typical Alpine Linux runtimes — :user:`asvetlov`.
2506 `#6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_
2507 - Started shipping platform-specific arm64 wheels for Apple Silicon — :user:`asvetlov`.
2508 `#6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_
2509
2510
2511 Bugfixes
2512 --------
2513
2514 - Modify _drain_helper() to handle concurrent `await resp.write(...)` or `ws.send_json(...)` calls without race-condition.
2515 `#2934 <https://github.com/aio-libs/aiohttp/issues/2934>`_
2516 - Started using `MultiLoopChildWatcher` when it's available under POSIX while setting up the test I/O loop.
2517 `#3450 <https://github.com/aio-libs/aiohttp/issues/3450>`_
2518 - Only encode content-disposition filename parameter using percent-encoding.
2519 Other parameters are encoded to quoted-string or RFC2231 extended parameter
2520 value.
2521 `#4012 <https://github.com/aio-libs/aiohttp/issues/4012>`_
2522 - Fixed HTTP client requests to honor ``no_proxy`` environment variables.
2523 `#4431 <https://github.com/aio-libs/aiohttp/issues/4431>`_
2524 - Fix supporting WebSockets proxies configured via environment variables.
2525 `#4648 <https://github.com/aio-libs/aiohttp/issues/4648>`_
2526 - Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations.
2527 `#4748 <https://github.com/aio-libs/aiohttp/issues/4748>`_
2528 - Ensure a cleanup context is cleaned up even when an exception occurs during startup.
2529 `#4799 <https://github.com/aio-libs/aiohttp/issues/4799>`_
2530 - Added a new exception type for Unix socket client errors which provides a more useful error message.
2531 `#4984 <https://github.com/aio-libs/aiohttp/issues/4984>`_
2532 - Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse
2533 `#5106 <https://github.com/aio-libs/aiohttp/issues/5106>`_
2534 - Only depend on typing_extensions for Python <3.8
2535 `#5107 <https://github.com/aio-libs/aiohttp/issues/5107>`_
2536 - Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode
2537 `#5192 <https://github.com/aio-libs/aiohttp/issues/5192>`_
2538 - Fix cookies disappearing from HTTPExceptions.
2539 `#5233 <https://github.com/aio-libs/aiohttp/issues/5233>`_
2540 - 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``.
2541 `#5250 <https://github.com/aio-libs/aiohttp/issues/5250>`_
2542 - Acquire the connection before running traces to prevent race condition.
2543 `#5259 <https://github.com/aio-libs/aiohttp/issues/5259>`_
2544 - Add missing slots to ```_RequestContextManager`` and ``_WSRequestContextManager``
2545 `#5329 <https://github.com/aio-libs/aiohttp/issues/5329>`_
2546 - Ensure sending a zero byte file does not throw an exception (round 2)
2547 `#5380 <https://github.com/aio-libs/aiohttp/issues/5380>`_
2548 - Set "text/plain" when data is an empty string in client requests.
2549 `#5392 <https://github.com/aio-libs/aiohttp/issues/5392>`_
2550 - Stop automatically releasing the ``ClientResponse`` object on calls to the ``ok`` property for the failed requests.
2551 `#5403 <https://github.com/aio-libs/aiohttp/issues/5403>`_
2552 - Include query parameters from `params` keyword argument in tracing `URL`.
2553 `#5432 <https://github.com/aio-libs/aiohttp/issues/5432>`_
2554 - Fix annotations
2555 `#5466 <https://github.com/aio-libs/aiohttp/issues/5466>`_
2556 - Fixed the multipart POST requests processing to always release file
2557 descriptors for the ``tempfile.Temporaryfile``-created
2558 ``_io.BufferedRandom`` instances of files sent within multipart request
2559 bodies via HTTP POST requests -- by :user:`webknjaz`.
2560 `#5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_
2561 - Fix 0 being incorrectly treated as an immediate timeout.
2562 `#5527 <https://github.com/aio-libs/aiohttp/issues/5527>`_
2563 - Fixes failing tests when an environment variable <scheme>_proxy is set.
2564 `#5554 <https://github.com/aio-libs/aiohttp/issues/5554>`_
2565 - 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``.
2566 `#5606 <https://github.com/aio-libs/aiohttp/issues/5606>`_
2567 - Fixed test for ``HTTPUnauthorized`` that access the ``text`` argument. This is not used in any part of the code, so it's removed now.
2568 `#5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_
2569 - Remove incorrect default from docs
2570 `#5727 <https://github.com/aio-libs/aiohttp/issues/5727>`_
2571 - Remove external test dependency to http://httpbin.org
2572 `#5840 <https://github.com/aio-libs/aiohttp/issues/5840>`_
2573 - Don't cancel current task when entering a cancelled timer.
2574 `#5853 <https://github.com/aio-libs/aiohttp/issues/5853>`_
2575 - Added ``params`` keyword argument to ``ClientSession.ws_connect``. -- :user:`hoh`.
2576 `#5868 <https://github.com/aio-libs/aiohttp/issues/5868>`_
2577 - Uses :py:class:`~asyncio.ThreadedChildWatcher` under POSIX to allow setting up test loop in non-main thread.
2578 `#5877 <https://github.com/aio-libs/aiohttp/issues/5877>`_
2579 - Fix the error in handling the return value of `getaddrinfo`.
2580 `getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family.
2581 It will cause a index out of range error in aiohttp. For example, if user compile CPython with
2582 `--disable-ipv6` option but his system enable the ipv6.
2583 `#5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_
2584 - Removed the deprecated ``loop`` argument from the ``asyncio.sleep``/``gather`` calls
2585 `#5905 <https://github.com/aio-libs/aiohttp/issues/5905>`_
2586 - 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.
2587 `#5925 <https://github.com/aio-libs/aiohttp/issues/5925>`_
2588 - Fix resetting `SIGCHLD` signals in Gunicorn aiohttp Worker to fix `subprocesses` that capture output having an incorrect `returncode`.
2589 `#6130 <https://github.com/aio-libs/aiohttp/issues/6130>`_
2590 - 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
2591 `#6182 <https://github.com/aio-libs/aiohttp/issues/6182>`_
2592
2593
2594 Improved Documentation
2595 ----------------------
2596
2597 - Refactored OpenAPI/Swagger aiohttp addons, added ``aio-openapi``
2598 `#5326 <https://github.com/aio-libs/aiohttp/issues/5326>`_
2599 - Fixed docs on request cookies type, so it matches what is actually used in the code (a
2600 read-only dictionary-like object).
2601 `#5725 <https://github.com/aio-libs/aiohttp/issues/5725>`_
2602 - Documented that the HTTP client ``Authorization`` header is removed
2603 on redirects to a different host or protocol.
2604 `#5850 <https://github.com/aio-libs/aiohttp/issues/5850>`_
2605
2606
2607 Misc
2608 ----
2609
2610 - `#3927 <https://github.com/aio-libs/aiohttp/issues/3927>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#5389 <https://github.com/aio-libs/aiohttp/issues/5389>`_, `#5457 <https://github.com/aio-libs/aiohttp/issues/5457>`_, `#5486 <https://github.com/aio-libs/aiohttp/issues/5486>`_, `#5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_, `#5515 <https://github.com/aio-libs/aiohttp/issues/5515>`_, `#5625 <https://github.com/aio-libs/aiohttp/issues/5625>`_, `#5635 <https://github.com/aio-libs/aiohttp/issues/5635>`_, `#5648 <https://github.com/aio-libs/aiohttp/issues/5648>`_, `#5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_, `#5890 <https://github.com/aio-libs/aiohttp/issues/5890>`_, `#5914 <https://github.com/aio-libs/aiohttp/issues/5914>`_, `#5932 <https://github.com/aio-libs/aiohttp/issues/5932>`_, `#6002 <https://github.com/aio-libs/aiohttp/issues/6002>`_, `#6045 <https://github.com/aio-libs/aiohttp/issues/6045>`_, `#6131 <https://github.com/aio-libs/aiohttp/issues/6131>`_, `#6156 <https://github.com/aio-libs/aiohttp/issues/6156>`_, `#6165 <https://github.com/aio-libs/aiohttp/issues/6165>`_, `#6166 <https://github.com/aio-libs/aiohttp/issues/6166>`_
2611
2612
2613 ----
2614
2615
2616 3.7.4.post0 (2021-03-06)
2617 ========================
2618
2619 Misc
2620 ----
2621
2622 - Bumped upper bound of the ``chardet`` runtime dependency
2623 to allow their v4.0 version stream.
2624 `#5366 <https://github.com/aio-libs/aiohttp/issues/5366>`_
2625
2626
2627 ----
2628
2629
2630 3.7.4 (2021-02-25)
2631 ==================
2632
2633 Bugfixes
2634 --------
2635
2636 - **(SECURITY BUG)** Started preventing open redirects in the
2637 ``aiohttp.web.normalize_path_middleware`` middleware. For
2638 more details, see
2639 https://github.com/aio-libs/aiohttp/security/advisories/GHSA-v6wp-4m6f-gcjg.
2640
2641 Thanks to `Beast Glatisant <https://github.com/g147>`__ for
2642 finding the first instance of this issue and `Jelmer Vernooij
2643 <https://jelmer.uk/>`__ for reporting and tracking it down
2644 in aiohttp.
2645 `#5497 <https://github.com/aio-libs/aiohttp/issues/5497>`_
2646 - Fix interpretation difference of the pure-Python and the Cython-based
2647 HTTP parsers construct a ``yarl.URL`` object for HTTP request-target.
2648
2649 Before this fix, the Python parser would turn the URI's absolute-path
2650 for ``//some-path`` into ``/`` while the Cython code preserved it as
2651 ``//some-path``. Now, both do the latter.
2652 `#5498 <https://github.com/aio-libs/aiohttp/issues/5498>`_
2653
2654
2655 ----
2656
2657
2658 3.7.3 (2020-11-18)
2659 ==================
2660
2661 Features
2662 --------
2663
2664 - Use Brotli instead of brotlipy
2665 `#3803 <https://github.com/aio-libs/aiohttp/issues/3803>`_
2666 - Made exceptions pickleable. Also changed the repr of some exceptions.
2667 `#4077 <https://github.com/aio-libs/aiohttp/issues/4077>`_
2668
2669
2670 Bugfixes
2671 --------
2672
2673 - Raise a ClientResponseError instead of an AssertionError for a blank
2674 HTTP Reason Phrase.
2675 `#3532 <https://github.com/aio-libs/aiohttp/issues/3532>`_
2676 - Fix ``web_middlewares.normalize_path_middleware`` behavior for patch without slash.
2677 `#3669 <https://github.com/aio-libs/aiohttp/issues/3669>`_
2678 - Fix overshadowing of overlapped sub-applications prefixes.
2679 `#3701 <https://github.com/aio-libs/aiohttp/issues/3701>`_
2680 - Make `BaseConnector.close()` a coroutine and wait until the client closes all connections. Drop deprecated "with Connector():" syntax.
2681 `#3736 <https://github.com/aio-libs/aiohttp/issues/3736>`_
2682 - Reset the ``sock_read`` timeout each time data is received for a ``aiohttp.client`` response.
2683 `#3808 <https://github.com/aio-libs/aiohttp/issues/3808>`_
2684 - Fixed type annotation for add_view method of UrlDispatcher to accept any subclass of View
2685 `#3880 <https://github.com/aio-libs/aiohttp/issues/3880>`_
2686 - Fixed querying the address families from DNS that the current host supports.
2687 `#5156 <https://github.com/aio-libs/aiohttp/issues/5156>`_
2688 - Change return type of MultipartReader.__aiter__() and BodyPartReader.__aiter__() to AsyncIterator.
2689 `#5163 <https://github.com/aio-libs/aiohttp/issues/5163>`_
2690 - Provide x86 Windows wheels.
2691 `#5230 <https://github.com/aio-libs/aiohttp/issues/5230>`_
2692
2693
2694 Improved Documentation
2695 ----------------------
2696
2697 - Add documentation for ``aiohttp.web.FileResponse``.
2698 `#3958 <https://github.com/aio-libs/aiohttp/issues/3958>`_
2699 - Removed deprecation warning in tracing example docs
2700 `#3964 <https://github.com/aio-libs/aiohttp/issues/3964>`_
2701 - Fixed wrong "Usage" docstring of ``aiohttp.client.request``.
2702 `#4603 <https://github.com/aio-libs/aiohttp/issues/4603>`_
2703 - Add aiohttp-pydantic to third party libraries
2704 `#5228 <https://github.com/aio-libs/aiohttp/issues/5228>`_
2705
2706
2707 Misc
2708 ----
2709
2710 - `#4102 <https://github.com/aio-libs/aiohttp/issues/4102>`_
2711
2712
2713 ----
2714
2715
2716 3.7.2 (2020-10-27)
2717 ==================
2718
2719 Bugfixes
2720 --------
2721
2722 - Fixed static files handling for loops without ``.sendfile()`` support
2723 `#5149 <https://github.com/aio-libs/aiohttp/issues/5149>`_
2724
2725
2726 ----
2727
2728
2729 3.7.1 (2020-10-25)
2730 ==================
2731
2732 Bugfixes
2733 --------
2734
2735 - Fixed a type error caused by the conditional import of `Protocol`.
2736 `#5111 <https://github.com/aio-libs/aiohttp/issues/5111>`_
2737 - Server doesn't send Content-Length for 1xx or 204
2738 `#4901 <https://github.com/aio-libs/aiohttp/issues/4901>`_
2739 - Fix run_app typing
2740 `#4957 <https://github.com/aio-libs/aiohttp/issues/4957>`_
2741 - Always require ``typing_extensions`` library.
2742 `#5107 <https://github.com/aio-libs/aiohttp/issues/5107>`_
2743 - Fix a variable-shadowing bug causing `ThreadedResolver.resolve` to
2744 return the resolved IP as the ``hostname`` in each record, which prevented
2745 validation of HTTPS connections.
2746 `#5110 <https://github.com/aio-libs/aiohttp/issues/5110>`_
2747 - Added annotations to all public attributes.
2748 `#5115 <https://github.com/aio-libs/aiohttp/issues/5115>`_
2749 - Fix flaky test_when_timeout_smaller_second
2750 `#5116 <https://github.com/aio-libs/aiohttp/issues/5116>`_
2751 - Ensure sending a zero byte file does not throw an exception
2752 `#5124 <https://github.com/aio-libs/aiohttp/issues/5124>`_
2753 - Fix a bug in ``web.run_app()`` about Python version checking on Windows
2754 `#5127 <https://github.com/aio-libs/aiohttp/issues/5127>`_
2755
2756
2757 ----
2758
2759
2760 3.7.0 (2020-10-24)
2761 ==================
2762
2763 Features
2764 --------
2765
2766 - Response headers are now prepared prior to running ``on_response_prepare`` hooks, directly before headers are sent to the client.
2767 `#1958 <https://github.com/aio-libs/aiohttp/issues/1958>`_
2768 - Add a ``quote_cookie`` option to ``CookieJar``, a way to skip quotation wrapping of cookies containing special characters.
2769 `#2571 <https://github.com/aio-libs/aiohttp/issues/2571>`_
2770 - Call ``AccessLogger.log`` with the current exception available from ``sys.exc_info()``.
2771 `#3557 <https://github.com/aio-libs/aiohttp/issues/3557>`_
2772 - `web.UrlDispatcher.add_routes` and `web.Application.add_routes` return a list
2773 of registered `AbstractRoute` instances. `AbstractRouteDef.register` (and all
2774 subclasses) return a list of registered resources registered resource.
2775 `#3866 <https://github.com/aio-libs/aiohttp/issues/3866>`_
2776 - Added properties of default ClientSession params to ClientSession class so it is available for introspection
2777 `#3882 <https://github.com/aio-libs/aiohttp/issues/3882>`_
2778 - Don't cancel web handler on peer disconnection, raise `OSError` on reading/writing instead.
2779 `#4080 <https://github.com/aio-libs/aiohttp/issues/4080>`_
2780 - Implement BaseRequest.get_extra_info() to access a protocol transports' extra info.
2781 `#4189 <https://github.com/aio-libs/aiohttp/issues/4189>`_
2782 - Added `ClientSession.timeout` property.
2783 `#4191 <https://github.com/aio-libs/aiohttp/issues/4191>`_
2784 - allow use of SameSite in cookies.
2785 `#4224 <https://github.com/aio-libs/aiohttp/issues/4224>`_
2786 - Use ``loop.sendfile()`` instead of custom implementation if available.
2787 `#4269 <https://github.com/aio-libs/aiohttp/issues/4269>`_
2788 - Apply SO_REUSEADDR to test server's socket.
2789 `#4393 <https://github.com/aio-libs/aiohttp/issues/4393>`_
2790 - Use .raw_host instead of slower .host in client API
2791 `#4402 <https://github.com/aio-libs/aiohttp/issues/4402>`_
2792 - Allow configuring the buffer size of input stream by passing ``read_bufsize`` argument.
2793 `#4453 <https://github.com/aio-libs/aiohttp/issues/4453>`_
2794 - Pass tests on Python 3.8 for Windows.
2795 `#4513 <https://github.com/aio-libs/aiohttp/issues/4513>`_
2796 - Add `method` and `url` attributes to `TraceRequestChunkSentParams` and `TraceResponseChunkReceivedParams`.
2797 `#4674 <https://github.com/aio-libs/aiohttp/issues/4674>`_
2798 - Add ClientResponse.ok property for checking status code under 400.
2799 `#4711 <https://github.com/aio-libs/aiohttp/issues/4711>`_
2800 - Don't ceil timeouts that are smaller than 5 seconds.
2801 `#4850 <https://github.com/aio-libs/aiohttp/issues/4850>`_
2802 - TCPSite now listens by default on all interfaces instead of just IPv4 when `None` is passed in as the host.
2803 `#4894 <https://github.com/aio-libs/aiohttp/issues/4894>`_
2804 - Bump ``http_parser`` to 2.9.4
2805 `#5070 <https://github.com/aio-libs/aiohttp/issues/5070>`_
2806
2807
2808 Bugfixes
2809 --------
2810
2811 - Fix keepalive connections not being closed in time
2812 `#3296 <https://github.com/aio-libs/aiohttp/issues/3296>`_
2813 - Fix failed websocket handshake leaving connection hanging.
2814 `#3380 <https://github.com/aio-libs/aiohttp/issues/3380>`_
2815 - Fix tasks cancellation order on exit. The run_app task needs to be cancelled first for cleanup hooks to run with all tasks intact.
2816 `#3805 <https://github.com/aio-libs/aiohttp/issues/3805>`_
2817 - Don't start heartbeat until _writer is set
2818 `#4062 <https://github.com/aio-libs/aiohttp/issues/4062>`_
2819 - Fix handling of multipart file uploads without a content type.
2820 `#4089 <https://github.com/aio-libs/aiohttp/issues/4089>`_
2821 - Preserve view handler function attributes across middlewares
2822 `#4174 <https://github.com/aio-libs/aiohttp/issues/4174>`_
2823 - Fix the string representation of ``ServerDisconnectedError``.
2824 `#4175 <https://github.com/aio-libs/aiohttp/issues/4175>`_
2825 - Raising RuntimeError when trying to get encoding from not read body
2826 `#4214 <https://github.com/aio-libs/aiohttp/issues/4214>`_
2827 - Remove warning messages from noop.
2828 `#4282 <https://github.com/aio-libs/aiohttp/issues/4282>`_
2829 - Raise ClientPayloadError if FormData re-processed.
2830 `#4345 <https://github.com/aio-libs/aiohttp/issues/4345>`_
2831 - Fix a warning about unfinished task in ``web_protocol.py``
2832 `#4408 <https://github.com/aio-libs/aiohttp/issues/4408>`_
2833 - Fixed 'deflate' compression. According to RFC 2616 now.
2834 `#4506 <https://github.com/aio-libs/aiohttp/issues/4506>`_
2835 - Fixed OverflowError on platforms with 32-bit time_t
2836 `#4515 <https://github.com/aio-libs/aiohttp/issues/4515>`_
2837 - Fixed request.body_exists returns wrong value for methods without body.
2838 `#4528 <https://github.com/aio-libs/aiohttp/issues/4528>`_
2839 - Fix connecting to link-local IPv6 addresses.
2840 `#4554 <https://github.com/aio-libs/aiohttp/issues/4554>`_
2841 - Fix a problem with connection waiters that are never awaited.
2842 `#4562 <https://github.com/aio-libs/aiohttp/issues/4562>`_
2843 - Always make sure transport is not closing before reuse a connection.
2844
2845 Reuse a protocol based on keepalive in headers is unreliable.
2846 For example, uWSGI will not support keepalive even it serves a
2847 HTTP 1.1 request, except explicitly configure uWSGI with a
2848 ``--http-keepalive`` option.
2849
2850 Servers designed like uWSGI could cause aiohttp intermittently
2851 raise a ConnectionResetException when the protocol poll runs
2852 out and some protocol is reused.
2853 `#4587 <https://github.com/aio-libs/aiohttp/issues/4587>`_
2854 - Handle the last CRLF correctly even if it is received via separate TCP segment.
2855 `#4630 <https://github.com/aio-libs/aiohttp/issues/4630>`_
2856 - Fix the register_resource function to validate route name before splitting it so that route name can include python keywords.
2857 `#4691 <https://github.com/aio-libs/aiohttp/issues/4691>`_
2858 - Improve typing annotations for ``web.Request``, ``aiohttp.ClientResponse`` and
2859 ``multipart`` module.
2860 `#4736 <https://github.com/aio-libs/aiohttp/issues/4736>`_
2861 - Fix resolver task is not awaited when connector is cancelled
2862 `#4795 <https://github.com/aio-libs/aiohttp/issues/4795>`_
2863 - Fix a bug "Aiohttp doesn't return any error on invalid request methods"
2864 `#4798 <https://github.com/aio-libs/aiohttp/issues/4798>`_
2865 - Fix HEAD requests for static content.
2866 `#4809 <https://github.com/aio-libs/aiohttp/issues/4809>`_
2867 - Fix incorrect size calculation for memoryview
2868 `#4890 <https://github.com/aio-libs/aiohttp/issues/4890>`_
2869 - Add HTTPMove to _all__.
2870 `#4897 <https://github.com/aio-libs/aiohttp/issues/4897>`_
2871 - Fixed the type annotations in the ``tracing`` module.
2872 `#4912 <https://github.com/aio-libs/aiohttp/issues/4912>`_
2873 - Fix typing for multipart ``__aiter__``.
2874 `#4931 <https://github.com/aio-libs/aiohttp/issues/4931>`_
2875 - Fix for race condition on connections in BaseConnector that leads to exceeding the connection limit.
2876 `#4936 <https://github.com/aio-libs/aiohttp/issues/4936>`_
2877 - Add forced UTF-8 encoding for ``application/rdap+json`` responses.
2878 `#4938 <https://github.com/aio-libs/aiohttp/issues/4938>`_
2879 - Fix inconsistency between Python and C http request parsers in parsing pct-encoded URL.
2880 `#4972 <https://github.com/aio-libs/aiohttp/issues/4972>`_
2881 - Fix connection closing issue in HEAD request.
2882 `#5012 <https://github.com/aio-libs/aiohttp/issues/5012>`_
2883 - Fix type hint on BaseRunner.addresses (from ``List[str]`` to ``List[Any]``)
2884 `#5086 <https://github.com/aio-libs/aiohttp/issues/5086>`_
2885 - Make `web.run_app()` more responsive to Ctrl+C on Windows for Python < 3.8. It slightly
2886 increases CPU load as a side effect.
2887 `#5098 <https://github.com/aio-libs/aiohttp/issues/5098>`_
2888
2889
2890 Improved Documentation
2891 ----------------------
2892
2893 - Fix example code in client quick-start
2894 `#3376 <https://github.com/aio-libs/aiohttp/issues/3376>`_
2895 - Updated the docs so there is no contradiction in ``ttl_dns_cache`` default value
2896 `#3512 <https://github.com/aio-libs/aiohttp/issues/3512>`_
2897 - Add 'Deploy with SSL' to docs.
2898 `#4201 <https://github.com/aio-libs/aiohttp/issues/4201>`_
2899 - Change typing of the secure argument on StreamResponse.set_cookie from ``Optional[str]`` to ``Optional[bool]``
2900 `#4204 <https://github.com/aio-libs/aiohttp/issues/4204>`_
2901 - Changes ``ttl_dns_cache`` type from int to Optional[int].
2902 `#4270 <https://github.com/aio-libs/aiohttp/issues/4270>`_
2903 - Simplify README hello word example and add a documentation page for people coming from requests.
2904 `#4272 <https://github.com/aio-libs/aiohttp/issues/4272>`_
2905 - Improve some code examples in the documentation involving websockets and starting a simple HTTP site with an AppRunner.
2906 `#4285 <https://github.com/aio-libs/aiohttp/issues/4285>`_
2907 - Fix typo in code example in Multipart docs
2908 `#4312 <https://github.com/aio-libs/aiohttp/issues/4312>`_
2909 - Fix code example in Multipart section.
2910 `#4314 <https://github.com/aio-libs/aiohttp/issues/4314>`_
2911 - Update contributing guide so new contributors read the most recent version of that guide. Update command used to create test coverage reporting.
2912 `#4810 <https://github.com/aio-libs/aiohttp/issues/4810>`_
2913 - Spelling: Change "canonize" to "canonicalize".
2914 `#4986 <https://github.com/aio-libs/aiohttp/issues/4986>`_
2915 - Add ``aiohttp-sse-client`` library to third party usage list.
2916 `#5084 <https://github.com/aio-libs/aiohttp/issues/5084>`_
2917
2918
2919 Misc
2920 ----
2921
2922 - `#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>`_
2923
2924
2925 ----
2926
2927
2928 3.6.3 (2020-10-12)
2929 ==================
2930
2931 Bugfixes
2932 --------
2933
2934 - Pin yarl to ``<1.6.0`` to avoid buggy behavior that will be fixed by the next aiohttp
2935 release.
2936
2937 3.6.2 (2019-10-09)
2938 ==================
2939
2940 Features
2941 --------
2942
2943 - Made exceptions pickleable. Also changed the repr of some exceptions.
2944 `#4077 <https://github.com/aio-libs/aiohttp/issues/4077>`_
2945 - Use ``Iterable`` type hint instead of ``Sequence`` for ``Application`` *middleware*
2946 parameter. `#4125 <https://github.com/aio-libs/aiohttp/issues/4125>`_
2947
2948
2949 Bugfixes
2950 --------
2951
2952 - Reset the ``sock_read`` timeout each time data is received for a
2953 ``aiohttp.ClientResponse``. `#3808
2954 <https://github.com/aio-libs/aiohttp/issues/3808>`_
2955 - Fix handling of expired cookies so they are not stored in CookieJar.
2956 `#4063 <https://github.com/aio-libs/aiohttp/issues/4063>`_
2957 - Fix misleading message in the string representation of ``ClientConnectorError``;
2958 ``self.ssl == None`` means default SSL context, not SSL disabled `#4097
2959 <https://github.com/aio-libs/aiohttp/issues/4097>`_
2960 - Don't clobber HTTP status when using FileResponse.
2961 `#4106 <https://github.com/aio-libs/aiohttp/issues/4106>`_
2962
2963
2964 Improved Documentation
2965 ----------------------
2966
2967 - Added minimal required logging configuration to logging documentation.
2968 `#2469 <https://github.com/aio-libs/aiohttp/issues/2469>`_
2969 - Update docs to reflect proxy support.
2970 `#4100 <https://github.com/aio-libs/aiohttp/issues/4100>`_
2971 - Fix typo in code example in testing docs.
2972 `#4108 <https://github.com/aio-libs/aiohttp/issues/4108>`_
2973
2974
2975 Misc
2976 ----
2977
2978 - `#4102 <https://github.com/aio-libs/aiohttp/issues/4102>`_
2979
2980
2981 ----
2982
2983
2984 3.6.1 (2019-09-19)
2985 ==================
2986
2987 Features
2988 --------
2989
2990 - Compatibility with Python 3.8.
2991 `#4056 <https://github.com/aio-libs/aiohttp/issues/4056>`_
2992
2993
2994 Bugfixes
2995 --------
2996
2997 - correct some exception string format
2998 `#4068 <https://github.com/aio-libs/aiohttp/issues/4068>`_
2999 - Emit a warning when ``ssl.OP_NO_COMPRESSION`` is
3000 unavailable because the runtime is built against
3001 an outdated OpenSSL.
3002 `#4052 <https://github.com/aio-libs/aiohttp/issues/4052>`_
3003 - Update multidict requirement to >= 4.5
3004 `#4057 <https://github.com/aio-libs/aiohttp/issues/4057>`_
3005
3006
3007 Improved Documentation
3008 ----------------------
3009
3010 - Provide pytest-aiohttp namespace for pytest fixtures in docs.
3011 `#3723 <https://github.com/aio-libs/aiohttp/issues/3723>`_
3012
3013
3014 ----
3015
3016
3017 3.6.0 (2019-09-06)
3018 ==================
3019
3020 Features
3021 --------
3022
3023 - Add support for Named Pipes (Site and Connector) under Windows. This feature requires
3024 Proactor event loop to work. `#3629
3025 <https://github.com/aio-libs/aiohttp/issues/3629>`_
3026 - Removed ``Transfer-Encoding: chunked`` header from websocket responses to be
3027 compatible with more http proxy servers. `#3798
3028 <https://github.com/aio-libs/aiohttp/issues/3798>`_
3029 - Accept non-GET request for starting websocket handshake on server side.
3030 `#3980 <https://github.com/aio-libs/aiohttp/issues/3980>`_
3031
3032
3033 Bugfixes
3034 --------
3035
3036 - Raise a ClientResponseError instead of an AssertionError for a blank
3037 HTTP Reason Phrase.
3038 `#3532 <https://github.com/aio-libs/aiohttp/issues/3532>`_
3039 - Fix an issue where cookies would sometimes not be set during a redirect.
3040 `#3576 <https://github.com/aio-libs/aiohttp/issues/3576>`_
3041 - Change normalize_path_middleware to use 308 redirect instead of 301.
3042
3043 This behavior should prevent clients from being unable to use PUT/POST
3044 methods on endpoints that are redirected because of a trailing slash.
3045 `#3579 <https://github.com/aio-libs/aiohttp/issues/3579>`_
3046 - Drop the processed task from ``all_tasks()`` list early. It prevents logging about a
3047 task with unhandled exception when the server is used in conjunction with
3048 ``asyncio.run()``. `#3587 <https://github.com/aio-libs/aiohttp/issues/3587>`_
3049 - ``Signal`` type annotation changed from ``Signal[Callable[['TraceConfig'],
3050 Awaitable[None]]]`` to ``Signal[Callable[ClientSession, SimpleNamespace, ...]``.
3051 `#3595 <https://github.com/aio-libs/aiohttp/issues/3595>`_
3052 - Use sanitized URL as Location header in redirects
3053 `#3614 <https://github.com/aio-libs/aiohttp/issues/3614>`_
3054 - Improve typing annotations for multipart.py along with changes required
3055 by mypy in files that references multipart.py.
3056 `#3621 <https://github.com/aio-libs/aiohttp/issues/3621>`_
3057 - Close session created inside ``aiohttp.request`` when unhandled exception occurs
3058 `#3628 <https://github.com/aio-libs/aiohttp/issues/3628>`_
3059 - Cleanup per-chunk data in generic data read. Memory leak fixed.
3060 `#3631 <https://github.com/aio-libs/aiohttp/issues/3631>`_
3061 - Use correct type for add_view and family
3062 `#3633 <https://github.com/aio-libs/aiohttp/issues/3633>`_
3063 - Fix _keepalive field in __slots__ of ``RequestHandler``.
3064 `#3644 <https://github.com/aio-libs/aiohttp/issues/3644>`_
3065 - Properly handle ConnectionResetError, to silence the "Cannot write to closing
3066 transport" exception when clients disconnect uncleanly.
3067 `#3648 <https://github.com/aio-libs/aiohttp/issues/3648>`_
3068 - Suppress pytest warnings due to ``test_utils`` classes
3069 `#3660 <https://github.com/aio-libs/aiohttp/issues/3660>`_
3070 - Fix overshadowing of overlapped sub-application prefixes.
3071 `#3701 <https://github.com/aio-libs/aiohttp/issues/3701>`_
3072 - Fixed return type annotation for WSMessage.json()
3073 `#3720 <https://github.com/aio-libs/aiohttp/issues/3720>`_
3074 - Properly expose TooManyRedirects publicly as documented.
3075 `#3818 <https://github.com/aio-libs/aiohttp/issues/3818>`_
3076 - Fix missing brackets for IPv6 in proxy CONNECT request
3077 `#3841 <https://github.com/aio-libs/aiohttp/issues/3841>`_
3078 - Make the signature of ``aiohttp.test_utils.TestClient.request`` match
3079 ``asyncio.ClientSession.request`` according to the docs `#3852
3080 <https://github.com/aio-libs/aiohttp/issues/3852>`_
3081 - Use correct style for re-exported imports, makes mypy ``--strict`` mode happy.
3082 `#3868 <https://github.com/aio-libs/aiohttp/issues/3868>`_
3083 - Fixed type annotation for add_view method of UrlDispatcher to accept any subclass of
3084 View `#3880 <https://github.com/aio-libs/aiohttp/issues/3880>`_
3085 - Made cython HTTP parser set Reason-Phrase of the response to an empty string if it is
3086 missing. `#3906 <https://github.com/aio-libs/aiohttp/issues/3906>`_
3087 - Add URL to the string representation of ClientResponseError.
3088 `#3959 <https://github.com/aio-libs/aiohttp/issues/3959>`_
3089 - Accept ``istr`` keys in ``LooseHeaders`` type hints.
3090 `#3976 <https://github.com/aio-libs/aiohttp/issues/3976>`_
3091 - Fixed race conditions in _resolve_host caching and throttling when tracing is enabled.
3092 `#4013 <https://github.com/aio-libs/aiohttp/issues/4013>`_
3093 - For URLs like "unix://localhost/..." set Host HTTP header to "localhost" instead of
3094 "localhost:None". `#4039 <https://github.com/aio-libs/aiohttp/issues/4039>`_
3095
3096
3097 Improved Documentation
3098 ----------------------
3099
3100 - Modify documentation for Background Tasks to remove deprecated usage of event loop.
3101 `#3526 <https://github.com/aio-libs/aiohttp/issues/3526>`_
3102 - use ``if __name__ == '__main__':`` in server examples.
3103 `#3775 <https://github.com/aio-libs/aiohttp/issues/3775>`_
3104 - Update documentation reference to the default access logger.
3105 `#3783 <https://github.com/aio-libs/aiohttp/issues/3783>`_
3106 - Improve documentation for ``web.BaseRequest.path`` and ``web.BaseRequest.raw_path``.
3107 `#3791 <https://github.com/aio-libs/aiohttp/issues/3791>`_
3108 - Removed deprecation warning in tracing example docs
3109 `#3964 <https://github.com/aio-libs/aiohttp/issues/3964>`_
3110
3111
3112 ----
3113
3114
3115 3.5.4 (2019-01-12)
3116 ==================
3117
3118 Bugfixes
3119 --------
3120
3121 - Fix stream ``.read()`` / ``.readany()`` / ``.iter_any()`` which used to return a
3122 partial content only in case of compressed content
3123 `#3525 <https://github.com/aio-libs/aiohttp/issues/3525>`_
3124
3125
3126 3.5.3 (2019-01-10)
3127 ==================
3128
3129 Bugfixes
3130 --------
3131
3132 - Fix type stubs for ``aiohttp.web.run_app(access_log=True)`` and fix edge case of
3133 ``access_log=True`` and the event loop being in debug mode. `#3504
3134 <https://github.com/aio-libs/aiohttp/issues/3504>`_
3135 - Fix ``aiohttp.ClientTimeout`` type annotations to accept ``None`` for fields
3136 `#3511 <https://github.com/aio-libs/aiohttp/issues/3511>`_
3137 - Send custom per-request cookies even if session jar is empty
3138 `#3515 <https://github.com/aio-libs/aiohttp/issues/3515>`_
3139 - Restore Linux binary wheels publishing on PyPI
3140
3141 ----
3142
3143
3144 3.5.2 (2019-01-08)
3145 ==================
3146
3147 Features
3148 --------
3149
3150 - ``FileResponse`` from ``web_fileresponse.py`` uses a ``ThreadPoolExecutor`` to work
3151 with files asynchronously. I/O based payloads from ``payload.py`` uses a
3152 ``ThreadPoolExecutor`` to work with I/O objects asynchronously. `#3313
3153 <https://github.com/aio-libs/aiohttp/issues/3313>`_
3154 - Internal Server Errors in plain text if the browser does not support HTML.
3155 `#3483 <https://github.com/aio-libs/aiohttp/issues/3483>`_
3156
3157
3158 Bugfixes
3159 --------
3160
3161 - Preserve MultipartWriter parts headers on write. Refactor the way how
3162 ``Payload.headers`` are handled. Payload instances now always have headers and
3163 Content-Type defined. Fix Payload Content-Disposition header reset after initial
3164 creation. `#3035 <https://github.com/aio-libs/aiohttp/issues/3035>`_
3165 - Log suppressed exceptions in ``GunicornWebWorker``.
3166 `#3464 <https://github.com/aio-libs/aiohttp/issues/3464>`_
3167 - Remove wildcard imports.
3168 `#3468 <https://github.com/aio-libs/aiohttp/issues/3468>`_
3169 - Use the same task for app initialization and web server handling in gunicorn workers.
3170 It allows to use Python3.7 context vars smoothly.
3171 `#3471 <https://github.com/aio-libs/aiohttp/issues/3471>`_
3172 - Fix handling of chunked+gzipped response when first chunk does not give uncompressed
3173 data `#3477 <https://github.com/aio-libs/aiohttp/issues/3477>`_
3174 - Replace ``collections.MutableMapping`` with ``collections.abc.MutableMapping`` to
3175 avoid a deprecation warning. `#3480
3176 <https://github.com/aio-libs/aiohttp/issues/3480>`_
3177 - ``Payload.size`` type annotation changed from ``Optional[float]`` to
3178 ``Optional[int]``. `#3484 <https://github.com/aio-libs/aiohttp/issues/3484>`_
3179 - Ignore done tasks when cancels pending activities on ``web.run_app`` finalization.
3180 `#3497 <https://github.com/aio-libs/aiohttp/issues/3497>`_
3181
3182
3183 Improved Documentation
3184 ----------------------
3185
3186 - Add documentation for ``aiohttp.web.HTTPException``.
3187 `#3490 <https://github.com/aio-libs/aiohttp/issues/3490>`_
3188
3189
3190 Misc
3191 ----
3192
3193 - `#3487 <https://github.com/aio-libs/aiohttp/issues/3487>`_
3194
3195
3196 ----
3197
3198
3199 3.5.1 (2018-12-24)
3200 ====================
3201
3202 - Fix a regression about ``ClientSession._requote_redirect_url`` modification in debug
3203 mode.
3204
3205 3.5.0 (2018-12-22)
3206 ====================
3207
3208 Features
3209 --------
3210
3211 - The library type annotations are checked in strict mode now.
3212 - Add support for setting cookies for individual request (`#2387
3213 <https://github.com/aio-libs/aiohttp/pull/2387>`_)
3214 - Application.add_domain implementation (`#2809
3215 <https://github.com/aio-libs/aiohttp/pull/2809>`_)
3216 - The default ``app`` in the request returned by ``test_utils.make_mocked_request`` can
3217 now have objects assigned to it and retrieved using the ``[]`` operator. (`#3174
3218 <https://github.com/aio-libs/aiohttp/pull/3174>`_)
3219 - Make ``request.url`` accessible when transport is closed. (`#3177
3220 <https://github.com/aio-libs/aiohttp/pull/3177>`_)
3221 - Add ``zlib_executor_size`` argument to ``Response`` constructor to allow compression
3222 to run in a background executor to avoid blocking the main thread and potentially
3223 triggering health check failures. (`#3205
3224 <https://github.com/aio-libs/aiohttp/pull/3205>`_)
3225 - Enable users to set ``ClientTimeout`` in ``aiohttp.request`` (`#3213
3226 <https://github.com/aio-libs/aiohttp/pull/3213>`_)
3227 - Don't raise a warning if ``NETRC`` environment variable is not set and ``~/.netrc``
3228 file doesn't exist. (`#3267 <https://github.com/aio-libs/aiohttp/pull/3267>`_)
3229 - Add default logging handler to web.run_app If the ``Application.debug``` flag is set
3230 and the default logger ``aiohttp.access`` is used, access logs will now be output
3231 using a *stderr* ``StreamHandler`` if no handlers are attached. Furthermore, if the
3232 default logger has no log level set, the log level will be set to ``DEBUG``. (`#3324
3233 <https://github.com/aio-libs/aiohttp/pull/3324>`_)
3234 - Add method argument to ``session.ws_connect()``. Sometimes server API requires a
3235 different HTTP method for WebSocket connection establishment. For example, ``Docker
3236 exec`` needs POST. (`#3378 <https://github.com/aio-libs/aiohttp/pull/3378>`_)
3237 - Create a task per request handling. (`#3406
3238 <https://github.com/aio-libs/aiohttp/pull/3406>`_)
3239
3240
3241 Bugfixes
3242 --------
3243
3244 - Enable passing ``access_log_class`` via ``handler_args`` (`#3158
3245 <https://github.com/aio-libs/aiohttp/pull/3158>`_)
3246 - Return empty bytes with end-of-chunk marker in empty stream reader. (`#3186
3247 <https://github.com/aio-libs/aiohttp/pull/3186>`_)
3248 - Accept ``CIMultiDictProxy`` instances for ``headers`` argument in ``web.Response``
3249 constructor. (`#3207 <https://github.com/aio-libs/aiohttp/pull/3207>`_)
3250 - Don't uppercase HTTP method in parser (`#3233
3251 <https://github.com/aio-libs/aiohttp/pull/3233>`_)
3252 - Make method match regexp RFC-7230 compliant (`#3235
3253 <https://github.com/aio-libs/aiohttp/pull/3235>`_)
3254 - Add ``app.pre_frozen`` state to properly handle startup signals in
3255 sub-applications. (`#3237 <https://github.com/aio-libs/aiohttp/pull/3237>`_)
3256 - Enhanced parsing and validation of helpers.BasicAuth.decode. (`#3239
3257 <https://github.com/aio-libs/aiohttp/pull/3239>`_)
3258 - Change imports from collections module in preparation for 3.8. (`#3258
3259 <https://github.com/aio-libs/aiohttp/pull/3258>`_)
3260 - Ensure Host header is added first to ClientRequest to better replicate browser (`#3265
3261 <https://github.com/aio-libs/aiohttp/pull/3265>`_)
3262 - Fix forward compatibility with Python 3.8: importing ABCs directly from the
3263 collections module will not be supported anymore. (`#3273
3264 <https://github.com/aio-libs/aiohttp/pull/3273>`_)
3265 - Keep the query string by ``normalize_path_middleware``. (`#3278
3266 <https://github.com/aio-libs/aiohttp/pull/3278>`_)
3267 - Fix missing parameter ``raise_for_status`` for aiohttp.request() (`#3290
3268 <https://github.com/aio-libs/aiohttp/pull/3290>`_)
3269 - Bracket IPv6 addresses in the HOST header (`#3304
3270 <https://github.com/aio-libs/aiohttp/pull/3304>`_)
3271 - Fix default message for server ping and pong frames. (`#3308
3272 <https://github.com/aio-libs/aiohttp/pull/3308>`_)
3273 - Fix tests/test_connector.py typo and tests/autobahn/server.py duplicate loop
3274 def. (`#3337 <https://github.com/aio-libs/aiohttp/pull/3337>`_)
3275 - Fix false-negative indicator end_of_HTTP_chunk in StreamReader.readchunk function
3276 (`#3361 <https://github.com/aio-libs/aiohttp/pull/3361>`_)
3277 - Release HTTP response before raising status exception (`#3364
3278 <https://github.com/aio-libs/aiohttp/pull/3364>`_)
3279 - Fix task cancellation when ``sendfile()`` syscall is used by static file
3280 handling. (`#3383 <https://github.com/aio-libs/aiohttp/pull/3383>`_)
3281 - Fix stack trace for ``asyncio.TimeoutError`` which was not logged, when it is caught
3282 in the handler. (`#3414 <https://github.com/aio-libs/aiohttp/pull/3414>`_)
3283
3284
3285 Improved Documentation
3286 ----------------------
3287
3288 - Improve documentation of ``Application.make_handler`` parameters. (`#3152
3289 <https://github.com/aio-libs/aiohttp/pull/3152>`_)
3290 - Fix BaseRequest.raw_headers doc. (`#3215
3291 <https://github.com/aio-libs/aiohttp/pull/3215>`_)
3292 - Fix typo in TypeError exception reason in ``web.Application._handle`` (`#3229
3293 <https://github.com/aio-libs/aiohttp/pull/3229>`_)
3294 - Make server access log format placeholder %b documentation reflect
3295 behavior and docstring. (`#3307 <https://github.com/aio-libs/aiohttp/pull/3307>`_)
3296
3297
3298 Deprecations and Removals
3299 -------------------------
3300
3301 - Deprecate modification of ``session.requote_redirect_url`` (`#2278
3302 <https://github.com/aio-libs/aiohttp/pull/2278>`_)
3303 - Deprecate ``stream.unread_data()`` (`#3260
3304 <https://github.com/aio-libs/aiohttp/pull/3260>`_)
3305 - Deprecated use of boolean in ``resp.enable_compression()`` (`#3318
3306 <https://github.com/aio-libs/aiohttp/pull/3318>`_)
3307 - Encourage creation of aiohttp public objects inside a coroutine (`#3331
3308 <https://github.com/aio-libs/aiohttp/pull/3331>`_)
3309 - Drop dead ``Connection.detach()`` and ``Connection.writer``. Both methods were broken
3310 for more than 2 years. (`#3358 <https://github.com/aio-libs/aiohttp/pull/3358>`_)
3311 - Deprecate ``app.loop``, ``request.loop``, ``client.loop`` and ``connector.loop``
3312 properties. (`#3374 <https://github.com/aio-libs/aiohttp/pull/3374>`_)
3313 - Deprecate explicit debug argument. Use asyncio debug mode instead. (`#3381
3314 <https://github.com/aio-libs/aiohttp/pull/3381>`_)
3315 - Deprecate body parameter in HTTPException (and derived classes) constructor. (`#3385
3316 <https://github.com/aio-libs/aiohttp/pull/3385>`_)
3317 - Deprecate bare connector close, use ``async with connector:`` and ``await
3318 connector.close()`` instead. (`#3417
3319 <https://github.com/aio-libs/aiohttp/pull/3417>`_)
3320 - Deprecate obsolete ``read_timeout`` and ``conn_timeout`` in ``ClientSession``
3321 constructor. (`#3438 <https://github.com/aio-libs/aiohttp/pull/3438>`_)
3322
3323
3324 Misc
3325 ----
3326
3327 - #3341, #3351
3328
3329
3330
3331
3332 ----
3333
3334
3335 3.4.4 (2018-09-05)
3336 ==================
3337
3338 - Fix installation from sources when compiling toolkit is not available (`#3241 <https://github.com/aio-libs/aiohttp/pull/3241>`_)
3339
3340
3341
3342
3343 ----
3344
3345
3346 3.4.3 (2018-09-04)
3347 ==================
3348
3349 - Add ``app.pre_frozen`` state to properly handle startup signals in sub-applications. (`#3237 <https://github.com/aio-libs/aiohttp/pull/3237>`_)
3350
3351
3352
3353
3354 ----
3355
3356
3357 3.4.2 (2018-09-01)
3358 ==================
3359
3360 - Fix ``iter_chunks`` type annotation (`#3230 <https://github.com/aio-libs/aiohttp/pull/3230>`_)
3361
3362
3363
3364
3365 ----
3366
3367
3368 3.4.1 (2018-08-28)
3369 ==================
3370
3371 - Fix empty header parsing regression. (`#3218 <https://github.com/aio-libs/aiohttp/pull/3218>`_)
3372 - Fix BaseRequest.raw_headers doc. (`#3215 <https://github.com/aio-libs/aiohttp/pull/3215>`_)
3373 - Fix documentation building on ReadTheDocs (`#3221 <https://github.com/aio-libs/aiohttp/pull/3221>`_)
3374
3375
3376
3377
3378 ----
3379
3380
3381 3.4.0 (2018-08-25)
3382 ==================
3383
3384 Features
3385 --------
3386
3387 - Add type hints (`#3049 <https://github.com/aio-libs/aiohttp/pull/3049>`_)
3388 - Add ``raise_for_status`` request parameter (`#3073 <https://github.com/aio-libs/aiohttp/pull/3073>`_)
3389 - Add type hints to HTTP client (`#3092 <https://github.com/aio-libs/aiohttp/pull/3092>`_)
3390 - Minor server optimizations (`#3095 <https://github.com/aio-libs/aiohttp/pull/3095>`_)
3391 - Preserve the cause when `HTTPException` is raised from another exception. (`#3096 <https://github.com/aio-libs/aiohttp/pull/3096>`_)
3392 - Add `close_boundary` option in `MultipartWriter.write` method. Support streaming (`#3104 <https://github.com/aio-libs/aiohttp/pull/3104>`_)
3393 - Added a ``remove_slash`` option to the ``normalize_path_middleware`` factory. (`#3173 <https://github.com/aio-libs/aiohttp/pull/3173>`_)
3394 - The class `AbstractRouteDef` is importable from `aiohttp.web`. (`#3183 <https://github.com/aio-libs/aiohttp/pull/3183>`_)
3395
3396
3397 Bugfixes
3398 --------
3399
3400 - Prevent double closing when client connection is released before the
3401 last ``data_received()`` callback. (`#3031 <https://github.com/aio-libs/aiohttp/pull/3031>`_)
3402 - Make redirect with `normalize_path_middleware` work when using url encoded paths. (`#3051 <https://github.com/aio-libs/aiohttp/pull/3051>`_)
3403 - Postpone web task creation to connection establishment. (`#3052 <https://github.com/aio-libs/aiohttp/pull/3052>`_)
3404 - Fix ``sock_read`` timeout. (`#3053 <https://github.com/aio-libs/aiohttp/pull/3053>`_)
3405 - When using a server-request body as the `data=` argument of a client request, iterate over the content with `readany` instead of `readline` to avoid `Line too long` errors. (`#3054 <https://github.com/aio-libs/aiohttp/pull/3054>`_)
3406 - fix `UrlDispatcher` has no attribute `add_options`, add `web.options` (`#3062 <https://github.com/aio-libs/aiohttp/pull/3062>`_)
3407 - correct filename in content-disposition with multipart body (`#3064 <https://github.com/aio-libs/aiohttp/pull/3064>`_)
3408 - Many HTTP proxies has buggy keepalive support.
3409 Let's not reuse connection but close it after processing every response. (`#3070 <https://github.com/aio-libs/aiohttp/pull/3070>`_)
3410 - raise 413 "Payload Too Large" rather than raising ValueError in request.post()
3411 Add helpful debug message to 413 responses (`#3087 <https://github.com/aio-libs/aiohttp/pull/3087>`_)
3412 - Fix `StreamResponse` equality, now that they are `MutableMapping` objects. (`#3100 <https://github.com/aio-libs/aiohttp/pull/3100>`_)
3413 - Fix server request objects comparison (`#3116 <https://github.com/aio-libs/aiohttp/pull/3116>`_)
3414 - Do not hang on `206 Partial Content` response with `Content-Encoding: gzip` (`#3123 <https://github.com/aio-libs/aiohttp/pull/3123>`_)
3415 - Fix timeout precondition checkers (`#3145 <https://github.com/aio-libs/aiohttp/pull/3145>`_)
3416
3417
3418 Improved Documentation
3419 ----------------------
3420
3421 - Add a new FAQ entry that clarifies that you should not reuse response
3422 objects in middleware functions. (`#3020 <https://github.com/aio-libs/aiohttp/pull/3020>`_)
3423 - Add FAQ section "Why is creating a ClientSession outside of an event loop dangerous?" (`#3072 <https://github.com/aio-libs/aiohttp/pull/3072>`_)
3424 - Fix link to Rambler (`#3115 <https://github.com/aio-libs/aiohttp/pull/3115>`_)
3425 - Fix TCPSite documentation on the Server Reference page. (`#3146 <https://github.com/aio-libs/aiohttp/pull/3146>`_)
3426 - Fix documentation build configuration file for Windows. (`#3147 <https://github.com/aio-libs/aiohttp/pull/3147>`_)
3427 - Remove no longer existing lingering_timeout parameter of Application.make_handler from documentation. (`#3151 <https://github.com/aio-libs/aiohttp/pull/3151>`_)
3428 - Mention that ``app.make_handler`` is deprecated, recommend to use runners
3429 API instead. (`#3157 <https://github.com/aio-libs/aiohttp/pull/3157>`_)
3430
3431
3432 Deprecations and Removals
3433 -------------------------
3434
3435 - Drop ``loop.current_task()`` from ``helpers.current_task()`` (`#2826 <https://github.com/aio-libs/aiohttp/pull/2826>`_)
3436 - Drop ``reader`` parameter from ``request.multipart()``. (`#3090 <https://github.com/aio-libs/aiohttp/pull/3090>`_)
3437
3438
3439
3440
3441 ----
3442
3443
3444 3.3.2 (2018-06-12)
3445 ==================
3446
3447 - Many HTTP proxies has buggy keepalive support. Let's not reuse connection but
3448 close it after processing every response. (`#3070 <https://github.com/aio-libs/aiohttp/pull/3070>`_)
3449
3450 - Provide vendor source files in tarball (`#3076 <https://github.com/aio-libs/aiohttp/pull/3076>`_)
3451
3452
3453
3454
3455 ----
3456
3457
3458 3.3.1 (2018-06-05)
3459 ==================
3460
3461 - Fix ``sock_read`` timeout. (`#3053 <https://github.com/aio-libs/aiohttp/pull/3053>`_)
3462 - When using a server-request body as the ``data=`` argument of a client request,
3463 iterate over the content with ``readany`` instead of ``readline`` to avoid ``Line
3464 too long`` errors. (`#3054 <https://github.com/aio-libs/aiohttp/pull/3054>`_)
3465
3466
3467
3468
3469 ----
3470
3471
3472 3.3.0 (2018-06-01)
3473 ==================
3474
3475 Features
3476 --------
3477
3478 - Raise ``ConnectionResetError`` instead of ``CancelledError`` on trying to
3479 write to a closed stream. (`#2499 <https://github.com/aio-libs/aiohttp/pull/2499>`_)
3480 - Implement ``ClientTimeout`` class and support socket read timeout. (`#2768 <https://github.com/aio-libs/aiohttp/pull/2768>`_)
3481 - Enable logging when ``aiohttp.web`` is used as a program (`#2956 <https://github.com/aio-libs/aiohttp/pull/2956>`_)
3482 - Add canonical property to resources (`#2968 <https://github.com/aio-libs/aiohttp/pull/2968>`_)
3483 - Forbid reading response BODY after release (`#2983 <https://github.com/aio-libs/aiohttp/pull/2983>`_)
3484 - Implement base protocol class to avoid a dependency from internal
3485 ``asyncio.streams.FlowControlMixin`` (`#2986 <https://github.com/aio-libs/aiohttp/pull/2986>`_)
3486 - Cythonize ``@helpers.reify``, 5% boost on macro benchmark (`#2995 <https://github.com/aio-libs/aiohttp/pull/2995>`_)
3487 - Optimize HTTP parser (`#3015 <https://github.com/aio-libs/aiohttp/pull/3015>`_)
3488 - Implement ``runner.addresses`` property. (`#3036 <https://github.com/aio-libs/aiohttp/pull/3036>`_)
3489 - Use ``bytearray`` instead of a list of ``bytes`` in websocket reader. It
3490 improves websocket message reading a little. (`#3039 <https://github.com/aio-libs/aiohttp/pull/3039>`_)
3491 - Remove heartbeat on closing connection on keepalive timeout. The used hack
3492 violates HTTP protocol. (`#3041 <https://github.com/aio-libs/aiohttp/pull/3041>`_)
3493 - Limit websocket message size on reading to 4 MB by default. (`#3045 <https://github.com/aio-libs/aiohttp/pull/3045>`_)
3494
3495
3496 Bugfixes
3497 --------
3498
3499 - Don't reuse a connection with the same URL but different proxy/TLS settings
3500 (`#2981 <https://github.com/aio-libs/aiohttp/pull/2981>`_)
3501 - When parsing the Forwarded header, the optional port number is now preserved.
3502 (`#3009 <https://github.com/aio-libs/aiohttp/pull/3009>`_)
3503
3504
3505 Improved Documentation
3506 ----------------------
3507
3508 - Make Change Log more visible in docs (`#3029 <https://github.com/aio-libs/aiohttp/pull/3029>`_)
3509 - Make style and grammar improvements on the FAQ page. (`#3030 <https://github.com/aio-libs/aiohttp/pull/3030>`_)
3510 - Document that signal handlers should be async functions since aiohttp 3.0
3511 (`#3032 <https://github.com/aio-libs/aiohttp/pull/3032>`_)
3512
3513
3514 Deprecations and Removals
3515 -------------------------
3516
3517 - Deprecate custom application's router. (`#3021 <https://github.com/aio-libs/aiohttp/pull/3021>`_)
3518
3519
3520 Misc
3521 ----
3522
3523 - #3008, #3011
3524
3525
3526
3527
3528 ----
3529
3530
3531 3.2.1 (2018-05-10)
3532 ==================
3533
3534 - Don't reuse a connection with the same URL but different proxy/TLS settings
3535 (`#2981 <https://github.com/aio-libs/aiohttp/pull/2981>`_)
3536
3537
3538
3539
3540 ----
3541
3542
3543 3.2.0 (2018-05-06)
3544 ==================
3545
3546 Features
3547 --------
3548
3549 - Raise ``TooManyRedirects`` exception when client gets redirected too many
3550 times instead of returning last response. (`#2631 <https://github.com/aio-libs/aiohttp/pull/2631>`_)
3551 - Extract route definitions into separate ``web_routedef.py`` file (`#2876 <https://github.com/aio-libs/aiohttp/pull/2876>`_)
3552 - Raise an exception on request body reading after sending response. (`#2895 <https://github.com/aio-libs/aiohttp/pull/2895>`_)
3553 - ClientResponse and RequestInfo now have real_url property, which is request
3554 url without fragment part being stripped (`#2925 <https://github.com/aio-libs/aiohttp/pull/2925>`_)
3555 - Speed up connector limiting (`#2937 <https://github.com/aio-libs/aiohttp/pull/2937>`_)
3556 - Added and links property for ClientResponse object (`#2948 <https://github.com/aio-libs/aiohttp/pull/2948>`_)
3557 - Add ``request.config_dict`` for exposing nested applications data. (`#2949 <https://github.com/aio-libs/aiohttp/pull/2949>`_)
3558 - Speed up HTTP headers serialization, server micro-benchmark runs 5% faster
3559 now. (`#2957 <https://github.com/aio-libs/aiohttp/pull/2957>`_)
3560 - Apply assertions in debug mode only (`#2966 <https://github.com/aio-libs/aiohttp/pull/2966>`_)
3561
3562
3563 Bugfixes
3564 --------
3565
3566 - expose property `app` for TestClient (`#2891 <https://github.com/aio-libs/aiohttp/pull/2891>`_)
3567 - Call on_chunk_sent when write_eof takes as a param the last chunk (`#2909 <https://github.com/aio-libs/aiohttp/pull/2909>`_)
3568 - A closing bracket was added to `__repr__` of resources (`#2935 <https://github.com/aio-libs/aiohttp/pull/2935>`_)
3569 - Fix compression of FileResponse (`#2942 <https://github.com/aio-libs/aiohttp/pull/2942>`_)
3570 - Fixes some bugs in the limit connection feature (`#2964 <https://github.com/aio-libs/aiohttp/pull/2964>`_)
3571
3572
3573 Improved Documentation
3574 ----------------------
3575
3576 - Drop ``async_timeout`` usage from documentation for client API in favor of
3577 ``timeout`` parameter. (`#2865 <https://github.com/aio-libs/aiohttp/pull/2865>`_)
3578 - Improve Gunicorn logging documentation (`#2921 <https://github.com/aio-libs/aiohttp/pull/2921>`_)
3579 - Replace multipart writer `.serialize()` method with `.write()` in
3580 documentation. (`#2965 <https://github.com/aio-libs/aiohttp/pull/2965>`_)
3581
3582
3583 Deprecations and Removals
3584 -------------------------
3585
3586 - Deprecate Application.make_handler() (`#2938 <https://github.com/aio-libs/aiohttp/pull/2938>`_)
3587
3588
3589 Misc
3590 ----
3591
3592 - #2958
3593
3594
3595
3596
3597 ----
3598
3599
3600 3.1.3 (2018-04-12)
3601 ==================
3602
3603 - Fix cancellation broadcast during DNS resolve (`#2910 <https://github.com/aio-libs/aiohttp/pull/2910>`_)
3604
3605
3606
3607
3608 ----
3609
3610
3611 3.1.2 (2018-04-05)
3612 ==================
3613
3614 - Make ``LineTooLong`` exception more detailed about actual data size (`#2863 <https://github.com/aio-libs/aiohttp/pull/2863>`_)
3615
3616 - Call ``on_chunk_sent`` when write_eof takes as a param the last chunk (`#2909 <https://github.com/aio-libs/aiohttp/pull/2909>`_)
3617
3618
3619
3620
3621 ----
3622
3623
3624 3.1.1 (2018-03-27)
3625 ==================
3626
3627 - Support *asynchronous iterators* (and *asynchronous generators* as
3628 well) in both client and server API as request / response BODY
3629 payloads. (`#2802 <https://github.com/aio-libs/aiohttp/pull/2802>`_)
3630
3631
3632
3633
3634 ----
3635
3636
3637 3.1.0 (2018-03-21)
3638 ==================
3639
3640 Welcome to aiohttp 3.1 release.
3641
3642 This is an *incremental* release, fully backward compatible with *aiohttp 3.0*.
3643
3644 But we have added several new features.
3645
3646 The most visible one is ``app.add_routes()`` (an alias for existing
3647 ``app.router.add_routes()``. The addition is very important because
3648 all *aiohttp* docs now uses ``app.add_routes()`` call in code
3649 snippets. All your existing code still do register routes / resource
3650 without any warning but you've got the idea for a favorite way: noisy
3651 ``app.router.add_get()`` is replaced by ``app.add_routes()``.
3652
3653 The library does not make a preference between decorators::
3654
3655 routes = web.RouteTableDef()
3656
3657 @routes.get('/')
3658 async def hello(request):
3659 return web.Response(text="Hello, world")
3660
3661 app.add_routes(routes)
3662
3663 and route tables as a list::
3664
3665 async def hello(request):
3666 return web.Response(text="Hello, world")
3667
3668 app.add_routes([web.get('/', hello)])
3669
3670 Both ways are equal, user may decide basing on own code taste.
3671
3672 Also we have a lot of minor features, bug fixes and documentation
3673 updates, see below.
3674
3675 Features
3676 --------
3677
3678 - Relax JSON content-type checking in the ``ClientResponse.json()`` to allow
3679 "application/xxx+json" instead of strict "application/json". (`#2206 <https://github.com/aio-libs/aiohttp/pull/2206>`_)
3680 - Bump C HTTP parser to version 2.8 (`#2730 <https://github.com/aio-libs/aiohttp/pull/2730>`_)
3681 - Accept a coroutine as an application factory in ``web.run_app`` and gunicorn
3682 worker. (`#2739 <https://github.com/aio-libs/aiohttp/pull/2739>`_)
3683 - Implement application cleanup context (``app.cleanup_ctx`` property). (`#2747 <https://github.com/aio-libs/aiohttp/pull/2747>`_)
3684 - Make ``writer.write_headers`` a coroutine. (`#2762 <https://github.com/aio-libs/aiohttp/pull/2762>`_)
3685 - Add tracking signals for getting request/response bodies. (`#2767 <https://github.com/aio-libs/aiohttp/pull/2767>`_)
3686 - Deprecate ClientResponseError.code in favor of .status to keep similarity
3687 with response classes. (`#2781 <https://github.com/aio-libs/aiohttp/pull/2781>`_)
3688 - Implement ``app.add_routes()`` method. (`#2787 <https://github.com/aio-libs/aiohttp/pull/2787>`_)
3689 - Implement ``web.static()`` and ``RouteTableDef.static()`` API. (`#2795 <https://github.com/aio-libs/aiohttp/pull/2795>`_)
3690 - Install a test event loop as default by ``asyncio.set_event_loop()``. The
3691 change affects aiohttp test utils but backward compatibility is not broken
3692 for 99.99% of use cases. (`#2804 <https://github.com/aio-libs/aiohttp/pull/2804>`_)
3693 - Refactor ``ClientResponse`` constructor: make logically required constructor
3694 arguments mandatory, drop ``_post_init()`` method. (`#2820 <https://github.com/aio-libs/aiohttp/pull/2820>`_)
3695 - Use ``app.add_routes()`` in server docs everywhere (`#2830 <https://github.com/aio-libs/aiohttp/pull/2830>`_)
3696 - Websockets refactoring, all websocket writer methods are converted into
3697 coroutines. (`#2836 <https://github.com/aio-libs/aiohttp/pull/2836>`_)
3698 - Provide ``Content-Range`` header for ``Range`` requests (`#2844 <https://github.com/aio-libs/aiohttp/pull/2844>`_)
3699
3700
3701 Bugfixes
3702 --------
3703
3704 - Fix websocket client return EofStream. (`#2784 <https://github.com/aio-libs/aiohttp/pull/2784>`_)
3705 - Fix websocket demo. (`#2789 <https://github.com/aio-libs/aiohttp/pull/2789>`_)
3706 - Property ``BaseRequest.http_range`` now returns a python-like slice when
3707 requesting the tail of the range. It's now indicated by a negative value in
3708 ``range.start`` rather then in ``range.stop`` (`#2805 <https://github.com/aio-libs/aiohttp/pull/2805>`_)
3709 - Close a connection if an unexpected exception occurs while sending a request
3710 (`#2827 <https://github.com/aio-libs/aiohttp/pull/2827>`_)
3711 - Fix firing DNS tracing events. (`#2841 <https://github.com/aio-libs/aiohttp/pull/2841>`_)
3712
3713
3714 Improved Documentation
3715 ----------------------
3716
3717 - Document behavior when cchardet detects encodings that are unknown to Python.
3718 (`#2732 <https://github.com/aio-libs/aiohttp/pull/2732>`_)
3719 - Add diagrams for tracing request life style. (`#2748 <https://github.com/aio-libs/aiohttp/pull/2748>`_)
3720 - Drop removed functionality for passing ``StreamReader`` as data at client
3721 side. (`#2793 <https://github.com/aio-libs/aiohttp/pull/2793>`_)