Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patchback/backports/3.11/1d170d37f476df705a9dcc3588e192e8ccb871c0/pr 7731 #9005

Closed
wants to merge 99 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
947b9a0
[PR #8755/d50f2759 backport][3.11] Update indirect dependencies with …
patchback[bot] Aug 19, 2024
c1b110b
Bump sphinxcontrib-applehelp from 1.0.2 to 1.0.4 (#8759)
dependabot[bot] Aug 19, 2024
7876997
Bump cfgv from 3.3.1 to 3.4.0 (#8764)
dependabot[bot] Aug 19, 2024
b4b8039
Bump pygments from 2.15.1 to 2.18.0 (#8766)
dependabot[bot] Aug 19, 2024
ff8800f
Bump backports-entry-points-selectable from 1.1.1 to 1.3.0 (#8769)
dependabot[bot] Aug 19, 2024
170c78d
Bump tqdm from 4.62.3 to 4.66.5 (#8771)
dependabot[bot] Aug 19, 2024
0c26269
Bump build from 1.0.3 to 1.2.1 (#8775)
dependabot[bot] Aug 19, 2024
eadc376
Bump pycares from 4.3.0 to 4.4.0 (#8774)
dependabot[bot] Aug 19, 2024
a5b66e3
Bump blockdiag from 2.0.1 to 3.0.0 (#8761)
dependabot[bot] Aug 20, 2024
ac614c5
Bump imagesize from 1.3.0 to 1.4.1 (#8783)
dependabot[bot] Aug 20, 2024
f417d96
Bump urllib3 from 1.26.7 to 2.2.2 (#8786)
dependabot[bot] Aug 20, 2024
9bd2769
Bump snowballstemmer from 2.1.0 to 2.2.0 (#8787)
dependabot[bot] Aug 20, 2024
47b31d6
Bump jinja2 from 3.0.3 to 3.1.4 (#8788)
dependabot[bot] Aug 20, 2024
91cd764
Bump python-dateutil from 2.8.2 to 2.9.0.post0 (#8790)
dependabot[bot] Aug 20, 2024
d76e8be
Bump aiohappyeyeballs from 2.3.7 to 2.4.0 (#8791)
dependabot[bot] Aug 20, 2024
b65d573
Bump certifi from 2023.7.22 to 2024.7.4 (#8793)
dependabot[bot] Aug 20, 2024
7e73d96
Bump zipp from 3.17.0 to 3.20.0 (#8795)
dependabot[bot] Aug 20, 2024
351e07b
Bump virtualenv from 20.10.0 to 20.26.3 (#8794)
dependabot[bot] Aug 20, 2024
5ee29e7
[PR #8776/11171b8d backport][3.11] Use more precise headers type (#8778)
patchback[bot] Aug 20, 2024
ae15bac
Drop Python 3.8 (#8797) (#8799)
Dreamsorcerer Aug 20, 2024
cace1d1
[PR #8800/17bf9127 backport][3.11] Upload junit to codecov (#8802)
patchback[bot] Aug 20, 2024
35b293b
Bump annotated-types from 0.5.0 to 0.7.0 (#8814)
dependabot[bot] Aug 21, 2024
4bab257
Bump incremental from 22.10.0 to 24.7.2 (#8815)
dependabot[bot] Aug 21, 2024
ec5c265
Bump packaging from 21.2 to 24.1 (#8817)
dependabot[bot] Aug 21, 2024
de76808
Bump pip from 23.2.1 to 24.2 (#8816)
dependabot[bot] Aug 21, 2024
d1bc141
Bump identify from 2.3.5 to 2.6.0 (#8818)
dependabot[bot] Aug 21, 2024
b644f7a
Bump importlib-metadata from 6.8.0 to 8.4.0 (#8820)
dependabot[bot] Aug 21, 2024
3a10ee2
Bump iniconfig from 1.1.1 to 2.0.0 (#8821)
dependabot[bot] Aug 21, 2024
37f1f6c
Bump setuptools from 68.0.0 to 73.0.1 (#8819)
dependabot[bot] Aug 21, 2024
8e4b2aa
Bump regex from 2021.11.10 to 2024.7.24 (#8826)
dependabot[bot] Aug 22, 2024
f6e3b71
Bump nodeenv from 1.6.0 to 1.9.1 (#8828)
dependabot[bot] Aug 22, 2024
f087b79
Bump markupsafe from 2.0.1 to 2.1.5 (#8830)
dependabot[bot] Aug 22, 2024
41cb0bf
Bump babel from 2.9.1 to 2.16.0 (#8836)
dependabot[bot] Aug 22, 2024
9af8919
Bump cryptography from 41.0.2 to 43.0.0 (#8837)
dependabot[bot] Aug 22, 2024
57b958e
Bump distlib from 0.3.7 to 0.3.8 (#8838)
dependabot[bot] Aug 22, 2024
f0c89d6
Bump gidgethub from 5.0.1 to 5.3.0 (#8841)
dependabot[bot] Aug 22, 2024
10746c2
Bump typer from 0.6.1 to 0.12.4 (#8840)
dependabot[bot] Aug 22, 2024
7f64912
Bump typing-extensions from 4.11.0 to 4.12.2 (#8839)
dependabot[bot] Aug 22, 2024
8a2a890
Fix Python parser chunked handling with multiple Transfer-Encoding va…
Dreamsorcerer Aug 22, 2024
385e430
[PR #8804/8156789a backport][3.11] docs: minor grammar fix in client_…
patchback[bot] Aug 23, 2024
f1be53e
Bump requests from 2.31.0 to 2.32.3 (#8859)
dependabot[bot] Aug 23, 2024
5319115
Bump sphinxcontrib-htmlhelp from 2.0.0 to 2.0.1 (#8860)
dependabot[bot] Aug 23, 2024
4cdbf01
Bump exceptiongroup from 1.1.2 to 1.2.2 (#8861)
dependabot[bot] Aug 23, 2024
17fa09f
Bump pycparser from 2.21 to 2.22 (#8862)
dependabot[bot] Aug 23, 2024
95e32fb
Bump charset-normalizer from 3.2.0 to 3.3.2 (#8863)
dependabot[bot] Aug 23, 2024
7173b33
Bump pydantic from 2.2.0 to 2.8.2 (#8864)
dependabot[bot] Aug 23, 2024
a74e4f0
Bump filelock from 3.12.2 to 3.15.4 (#8867)
dependabot[bot] Aug 23, 2024
3b3156e
[PR #8846/4dd8c807 backport][3.11] Format status lines with f-strings…
patchback[bot] Aug 23, 2024
b4092d9
No default Content-Type when no content (#8858) (#8871)
Dreamsorcerer Aug 23, 2024
8fd19cb
Bump typer from 0.12.4 to 0.12.5 (#8879)
dependabot[bot] Aug 26, 2024
9b136b9
Bump pytz from 2023.3.post1 to 2024.1 (#8880)
dependabot[bot] Aug 26, 2024
6dd4c10
Bump mypy from 1.11.1 to 1.11.2 (#8881)
dependabot[bot] Aug 26, 2024
cb9fa5c
Bump pyyaml from 6.0.1 to 6.0.2 (#8866)
dependabot[bot] Aug 26, 2024
d73e5c4
Bump platformdirs from 3.10.0 to 4.2.2 (#8883)
dependabot[bot] Aug 26, 2024
996204a
Bump webcolors from 1.11.1 to 24.8.0 (#8865)
dependabot[bot] Aug 26, 2024
400feb6
Return 500 error when handler has wrong return type (#8845) (#8891)
Dreamsorcerer Aug 26, 2024
b2e1294
[PR #5344/bff76313 backport][3.11] Fix StreamResponse.prepared not re…
patchback[bot] Aug 26, 2024
275985c
[PR #8874/d6a677d1 backport][3.11] Update testing utility examples (#…
patchback[bot] Aug 26, 2024
a74e818
Fix server disconnect when error after 100-continue (#8876) (#8899)
Dreamsorcerer Aug 26, 2024
68629b5
Cache the hash generation of the ConnectionKey (#8895)
bdraco Aug 26, 2024
6c7aebb
Ensure error is raised when reading from closed client response. (#88…
Dreamsorcerer Aug 26, 2024
770fdcb
[PR #8847/6d974274 backport][3.11] Improve performance of handling sk…
patchback[bot] Aug 26, 2024
adcdf5c
[PR #8875/0478f143 backport][3.11] Fix unclosed transport warning (#8…
patchback[bot] Aug 26, 2024
cadffc7
Bump wheel from 0.37.0 to 0.44.0 (#8910)
dependabot[bot] Aug 27, 2024
fe85c54
Bump pyproject-hooks from 1.0.0 to 1.1.0 (#8911)
dependabot[bot] Aug 27, 2024
124181f
Bump rich from 13.7.1 to 13.8.0 (#8913)
dependabot[bot] Aug 27, 2024
a0ec949
Bump importlib-resources from 6.1.1 to 6.4.4 (#8915)
dependabot[bot] Aug 27, 2024
94d2cb5
Bump click from 8.0.3 to 8.1.7 (#8917)
dependabot[bot] Aug 27, 2024
36647c6
Bump alabaster from 0.7.12 to 0.7.13 (#8918)
dependabot[bot] Aug 27, 2024
b0a97da
Bump zipp from 3.20.0 to 3.20.1 (#8923)
dependabot[bot] Aug 28, 2024
a69a25a
Bump setuptools from 73.0.1 to 74.0.0 (#8924)
dependabot[bot] Aug 28, 2024
5e498df
Support credentials in URL with empty user (#6494) (#6495) (#8926)
Dreamsorcerer Aug 28, 2024
daa4d5f
[PR #8930/1575360e backport][3.11] Fix limit docs (#8932)
patchback[bot] Aug 29, 2024
37b2604
[PR #8929/c0c3376e backport][3.11] Fix Site.name with empty host (#8935)
patchback[bot] Aug 29, 2024
1dc3cd6
Fix Response.text when body is Payload (#6485) (#8937)
Dreamsorcerer Aug 29, 2024
8173932
[PR #8920/5cf5db56 backport][3.11] Re-enable keep-alive on proxies (#…
patchback[bot] Aug 29, 2024
297ddae
Fix tarfile file-like objects used as data (#6747) (#8940)
Dreamsorcerer Aug 30, 2024
45f8212
Bump certifi from 2024.7.4 to 2024.8.30 (#8943)
dependabot[bot] Aug 30, 2024
aa90362
[PR #8936/76a00d1e backport][3.11] Test coverage of TextIOWrapper (#8…
patchback[bot] Aug 30, 2024
784604e
[PR #8948/cc6d7632 backport][3.11] Make n argument clearer (#8950)
patchback[bot] Aug 30, 2024
e8d6638
[PR #8953/51ea3b39 backport][3.11] Add clarification about auth param…
patchback[bot] Aug 31, 2024
7477503
Add parameters to del_cookie() (#8956) (#8959)
Dreamsorcerer Aug 31, 2024
9ac6853
Fix router matching pre-encoded URLs (#8898) (#8960)
Dreamsorcerer Aug 31, 2024
4614dea
Add aiohttp.tracing.TraceRequestHeadersSentParams into the top level …
Hadock-is-ok Aug 31, 2024
b73a4c1
Deprecate obsolete timeout in ClientSession.ws_connect() (#3946) (#8965)
Dreamsorcerer Sep 1, 2024
9503cf7
[PR #7168/8a525d98 backport][3.11] Fix `test_utils.make_mocked_reques…
patchback[bot] Sep 1, 2024
0fdcc29
Fix CancelledError stopping other cleanup contexts completing (#8908)…
Dreamsorcerer Sep 1, 2024
306e42d
Avoid logging exception from run_app() that is also raised (#8951) (#…
Dreamsorcerer Sep 1, 2024
be27f79
[PR #8966/f569894c backport][3.11] Fix auth reset logic during redire…
patchback[bot] Sep 1, 2024
2af23ab
[PR #8933/8f3b1f44 backport][3.11] Small cleanups to the websocket fr…
patchback[bot] Sep 1, 2024
553e311
[PR #8968/8daecf5c backport][3.11] List specific timeouts for each ex…
patchback[bot] Sep 2, 2024
ea31633
Fix resolve_host "Task was destroyed but it is pending" errors (#8967…
Dreamsorcerer Sep 2, 2024
a86689f
Bump yarl from 1.9.6 to 1.9.7 (#8986)
dependabot[bot] Sep 2, 2024
ed5576d
[PR #8987/5c3d50f9 backport][3.11] Move ContentDisposition in referen…
patchback[bot] Sep 2, 2024
effb575
[PR #8991/1ba30112 backport][3.11] Update ClientSession reference (#8…
patchback[bot] Sep 2, 2024
fa628a2
[PR #8990/731ba4dd backport][3.11] Fix changing scheme/host in Respon…
patchback[bot] Sep 2, 2024
ba201c4
Bump setuptools from 74.0.0 to 74.1.0 (#9001)
dependabot[bot] Sep 3, 2024
a3fa8d8
Fix cancelled payload send leading to hung connection (#8992) (#9002)
Dreamsorcerer Sep 3, 2024
ff878e0
Add flake8-no-implicit-concat (#7731)
booniepepper Aug 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
codecov:
branch: 3.9
branch: master
notify:
after_n_builds: 13

Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ updates:
# Maintain dependencies for Python
- package-ecosystem: "pip"
directory: "/"
allow:
- dependency-type: "all"
labels:
- dependencies
schedule:
Expand All @@ -31,6 +33,8 @@ updates:
# Maintain dependencies for Python aiohttp backport
- package-ecosystem: "pip"
directory: "/"
allow:
- dependency-type: "all"
labels:
- dependencies
target-branch: "3.11"
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,13 @@ jobs:
needs: gen_llhttp
strategy:
matrix:
pyver: [3.8, 3.9, '3.10', '3.11', '3.12']
pyver: [3.9, '3.10', '3.11', '3.12']
no-extensions: ['', 'Y']
os: [ubuntu, macos, windows]
experimental: [false]
exclude:
- os: macos
no-extensions: 'Y'
- os: macos
pyver: 3.8
- os: windows
no-extensions: 'Y'
include:
Expand Down Expand Up @@ -198,7 +196,7 @@ jobs:
PIP_USER: 1
run: >-
PATH="${HOME}/Library/Python/3.11/bin:${HOME}/.local/bin:${PATH}"
pytest
pytest --junitxml=junit.xml
shell: bash
- name: Re-run the failing tests with maximum verbosity
if: failure()
Expand Down Expand Up @@ -234,6 +232,11 @@ jobs:
steps.python-install.outputs.python-version
}}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ repos:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.6.0
- flake8-no-implicit-concat==0.3.4
- flake8-requirements==1.7.8
exclude: "^docs/"
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
Expand Down
1 change: 1 addition & 0 deletions CHANGES/3945.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate obsolete `timeout: float` and `receive_timeout: Optional[float]` in `ClientSession.ws_connect()`. Change default websocket receive timeout from `None` to `10.0`.
1 change: 1 addition & 0 deletions CHANGES/5343.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed StreamResponse.prepared to return True after EOF is sent -- by :user:`arthurdarcet`.
1 change: 1 addition & 0 deletions CHANGES/6485.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ``Response.text`` when body is a ``Payload`` -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/6494.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for URL credentials with empty (zero-length) username, e.g. ``https://:password@host`` -- by :user:`shuckc`
1 change: 1 addition & 0 deletions CHANGES/6732.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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`.
1 change: 1 addition & 0 deletions CHANGES/6764.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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`.
1 change: 1 addition & 0 deletions CHANGES/6807.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stopped logging exceptions from ``web.run_app()`` that would be raised regardless -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/7167.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed ``make_mocked_request()`` to use empty payload by default -- by :user:`rahulnht`.
1 change: 1 addition & 0 deletions CHANGES/7731.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added flake8 settings to avoid some forms of implicit concatenation. -- by :user:`booniepepper`.
1 change: 1 addition & 0 deletions CHANGES/8612.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Exported ``ClientWSTimeout`` to top-level namespace -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8768.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Used more precise type for ``ClientResponseError.headers``, fixing some type errors when using them -- by :user:`Dreamorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8797.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dropped support for Python 3.8 -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8823.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed Python parser chunked handling with multiple Transfer-Encoding values -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8845.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed behaviour when returning an invalid response to send a 500 response -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8847.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved performance of making requests when there are no auto headers to skip -- by :user:`bdraco`.
1 change: 1 addition & 0 deletions CHANGES/8858.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stopped adding a default Content-Type header when response has no content -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8875.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an unclosed transport ``ResourceWarning`` on web handlers -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8876.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed error handling after 100-continue so server sends 500 response instead of disconnecting -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8878.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed response reading from closed session to throw an error immediately instead of timing out -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8898.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed web router not matching pre-encoded URLs (requires yarl 1.9.6+) -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8908.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ``CancelledError`` from one cleanup context stopping other contexts from completing -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8920.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enabled keep-alive support on proxies (which was originally disabled several years ago) -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8929.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ``Site.name`` when host is an empty string -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8947.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Exported ``aiohttp.TraceRequestHeadersSentParams`` -- by :user:`Hadock-is-ok`.
1 change: 1 addition & 0 deletions CHANGES/8956.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added ``secure``/``httponly``/``samesite`` parameters to ``.del_cookie()`` -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8966.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated ClientSession's auth logic to include default auth only if the request URL's origin matches _base_url; otherwise, the auth will not be included -- by :user:`MaximZemskov`
1 change: 1 addition & 0 deletions CHANGES/8967.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed resolve_host() 'Task was destroyed but is pending' errors -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8968.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarified which timeout exceptions happen on which timeouts -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8990.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed changing scheme/host in ``Response.clone()`` for absolute URLs -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8991.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated ``ClientSession`` parameters to match current code -- by :user:`Dreamsorcerer`.
1 change: 1 addition & 0 deletions CHANGES/8992.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed client incorrectly reusing a connection when the previous message had not been fully sent -- by :user:`Dreamsorcerer`.
3 changes: 3 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Chih-Yuan Chen
Chris AtLee
Chris Laws
Chris Moore
Chris Shucksmith
Christopher Schmitt
Claudiu Popa
Colin Dunklau
Expand Down Expand Up @@ -273,6 +274,7 @@ Philipp A.
Pieter van Beek
Qiao Han
Rafael Viotti
Rahul Nahata
Raphael Bialon
Raúl Cumplido
Required Field
Expand Down Expand Up @@ -352,6 +354,7 @@ William Grzybowski
William S.
Wilson Ong
wouter bolsterlee
Xavier Halloran
Xiang Li
Yang Zhou
Yannick Koechlin
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ define run_tests_in_docker
docker run --rm -ti -v `pwd`:/src -w /src "aiohttp-test-$(1)-$(2)" $(TEST_SPEC)
endef

.PHONY: test-3.8-no-extensions test-3.8 test-3.9-no-extensions test
test-3.8-no-extensions:
$(call run_tests_in_docker,3.8,y)
test-3.8:
$(call run_tests_in_docker,3.8,n)
.PHONY: test-3.9-no-extensions test
test-3.9-no-extensions:
$(call run_tests_in_docker,3.9,y)
test-3.9:
Expand Down
4 changes: 4 additions & 0 deletions aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
ClientSSLError,
ClientTimeout,
ClientWebSocketResponse,
ClientWSTimeout,
ConnectionTimeoutError,
ContentTypeError,
Fingerprint,
Expand Down Expand Up @@ -106,6 +107,7 @@
TraceRequestChunkSentParams as TraceRequestChunkSentParams,
TraceRequestEndParams as TraceRequestEndParams,
TraceRequestExceptionParams as TraceRequestExceptionParams,
TraceRequestHeadersSentParams as TraceRequestHeadersSentParams,
TraceRequestRedirectParams as TraceRequestRedirectParams,
TraceRequestStartParams as TraceRequestStartParams,
TraceResponseChunkReceivedParams as TraceResponseChunkReceivedParams,
Expand Down Expand Up @@ -138,6 +140,7 @@
"ClientSession",
"ClientTimeout",
"ClientWebSocketResponse",
"ClientWSTimeout",
"ConnectionTimeoutError",
"ContentTypeError",
"Fingerprint",
Expand Down Expand Up @@ -224,6 +227,7 @@
"TraceRequestChunkSentParams",
"TraceRequestEndParams",
"TraceRequestExceptionParams",
"TraceRequestHeadersSentParams",
"TraceRequestRedirectParams",
"TraceRequestStartParams",
"TraceResponseChunkReceivedParams",
Expand Down
59 changes: 45 additions & 14 deletions aiohttp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@
RequestInfo as RequestInfo,
_merge_ssl_params,
)
from .client_ws import ClientWebSocketResponse as ClientWebSocketResponse
from .client_ws import (
DEFAULT_WS_CLIENT_TIMEOUT,
ClientWebSocketResponse as ClientWebSocketResponse,
ClientWSTimeout as ClientWSTimeout,
)
from .connector import (
HTTP_AND_EMPTY_SCHEMA_SET,
BaseConnector as BaseConnector,
Expand Down Expand Up @@ -142,6 +146,7 @@
# client
"ClientSession",
"ClientTimeout",
"ClientWSTimeout",
"request",
)

Expand Down Expand Up @@ -305,15 +310,15 @@ def __init__(
self._timeout = DEFAULT_TIMEOUT
if read_timeout is not sentinel:
warnings.warn(
"read_timeout is deprecated, " "use timeout argument instead",
"read_timeout is deprecated, use timeout argument instead",
DeprecationWarning,
stacklevel=2,
)
self._timeout = attr.evolve(self._timeout, total=read_timeout)
if conn_timeout is not None:
self._timeout = attr.evolve(self._timeout, connect=conn_timeout)
warnings.warn(
"conn_timeout is deprecated, " "use timeout argument instead",
"conn_timeout is deprecated, use timeout argument instead",
DeprecationWarning,
stacklevel=2,
)
Expand Down Expand Up @@ -592,7 +597,10 @@ async def _request(

if auth is None:
auth = auth_from_url
if auth is None:

if auth is None and (
not self._base_url or self._base_url.origin() == url.origin()
):
auth = self._default_auth
# It would be confusing if we support explicit
# Authorization header with auth argument
Expand Down Expand Up @@ -627,7 +635,7 @@ async def _request(
url,
params=params,
headers=headers,
skip_auto_headers=skip_headers,
skip_auto_headers=skip_headers if skip_headers else None,
data=data,
cookies=all_cookies,
auth=auth,
Expand Down Expand Up @@ -820,7 +828,7 @@ def ws_connect(
*,
method: str = hdrs.METH_GET,
protocols: Iterable[str] = (),
timeout: float = 10.0,
timeout: Union[ClientWSTimeout, _SENTINEL] = sentinel,
receive_timeout: Optional[float] = None,
autoclose: bool = True,
autoping: bool = True,
Expand Down Expand Up @@ -872,7 +880,7 @@ async def _ws_connect(
*,
method: str = hdrs.METH_GET,
protocols: Iterable[str] = (),
timeout: float = 10.0,
timeout: Union[ClientWSTimeout, _SENTINEL] = sentinel,
receive_timeout: Optional[float] = None,
autoclose: bool = True,
autoping: bool = True,
Expand All @@ -891,6 +899,29 @@ async def _ws_connect(
compress: int = 0,
max_msg_size: int = 4 * 1024 * 1024,
) -> ClientWebSocketResponse:
if timeout is not sentinel:
if isinstance(timeout, ClientWSTimeout):
ws_timeout = timeout
else:
warnings.warn(
"parameter 'timeout' of type 'float' "
"is deprecated, please use "
"'timeout=ClientWSTimeout(ws_close=...)'",
DeprecationWarning,
stacklevel=2,
)
ws_timeout = ClientWSTimeout(ws_close=timeout)
else:
ws_timeout = DEFAULT_WS_CLIENT_TIMEOUT
if receive_timeout is not None:
warnings.warn(
"float parameter 'receive_timeout' "
"is deprecated, please use parameter "
"'timeout=ClientWSTimeout(ws_receive=...)'",
DeprecationWarning,
stacklevel=2,
)
ws_timeout = attr.evolve(ws_timeout, ws_receive=receive_timeout)

if headers is None:
real_headers: CIMultiDict[str] = CIMultiDict()
Expand Down Expand Up @@ -1021,12 +1052,13 @@ async def _ws_connect(

# For WS connection the read_timeout must be either receive_timeout or greater
# None == no timeout, i.e. infinite timeout, so None is the max timeout possible
if receive_timeout is None:
if ws_timeout.ws_receive is None:
# Reset regardless
conn_proto.read_timeout = receive_timeout
conn_proto.read_timeout = None
elif conn_proto.read_timeout is not None:
# If read_timeout was set check which wins
conn_proto.read_timeout = max(receive_timeout, conn_proto.read_timeout)
conn_proto.read_timeout = max(
ws_timeout.ws_receive, conn_proto.read_timeout
)

transport = conn.transport
assert transport is not None
Expand All @@ -1050,11 +1082,10 @@ async def _ws_connect(
writer,
protocol,
resp,
timeout,
ws_timeout,
autoclose,
autoping,
self._loop,
receive_timeout=receive_timeout,
heartbeat=heartbeat,
compress=compress,
client_notakeover=notakeover,
Expand Down Expand Up @@ -1224,7 +1255,7 @@ def requote_redirect_url(self) -> bool:
def requote_redirect_url(self, val: bool) -> None:
"""Do URL requoting on redirection handling."""
warnings.warn(
"session.requote_redirect_url modification " "is deprecated #2778",
"session.requote_redirect_url modification is deprecated #2778",
DeprecationWarning,
stacklevel=2,
)
Expand Down
6 changes: 4 additions & 2 deletions aiohttp/client_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import warnings
from typing import TYPE_CHECKING, Optional, Tuple, Union

from multidict import MultiMapping

from .http_parser import RawResponseMessage
from .typedefs import LooseHeaders, StrOrURL
from .typedefs import StrOrURL

try:
import ssl
Expand Down Expand Up @@ -71,7 +73,7 @@ def __init__(
code: Optional[int] = None,
status: Optional[int] = None,
message: str = "",
headers: Optional[LooseHeaders] = None,
headers: Optional[MultiMapping[str]] = None,
) -> None:
self.request_info = request_info
if code is not None:
Expand Down
3 changes: 0 additions & 3 deletions aiohttp/client_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ def should_close(self) -> bool:
or bool(self._tail)
)

def force_close(self) -> None:
self._should_close = True

def close(self) -> None:
transport = self.transport
if transport is not None:
Expand Down
Loading
Loading