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

Fix typing errors on content_disposition_header() #8698

Merged
merged 12 commits into from
Aug 14, 2024

Conversation

Dreamsorcerer
Copy link
Member

@Dreamsorcerer Dreamsorcerer commented Aug 14, 2024

The signature for the function doesn't type check well. If we unpack a dict[str, str], we'll get a type error because quote_fields requires a bool and could be included in the unpacked arguments. All locations using the function seem to have a dict anyway...

This appears to be an internal function, not documented in our API, so risk should be low by changing the signature. Though will only do it on master anyway.

@Dreamsorcerer Dreamsorcerer added bot:chronographer:skip This PR does not need to include a change note backport:skip Skip backport bot labels Aug 14, 2024
aiohttp/payload.py Outdated Show resolved Hide resolved
tests/test_helpers.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.96%. Comparing base (7d593ec) to head (43404c7).
Report is 2820 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8698      +/-   ##
==========================================
+ Coverage   97.69%   97.96%   +0.27%     
==========================================
  Files         108      107       -1     
  Lines       34075    33861     -214     
  Branches     4055     3970      -85     
==========================================
- Hits        33288    33171     -117     
+ Misses        587      513      -74     
+ Partials      200      177      -23     
Flag Coverage Δ
CI-GHA 97.86% <100.00%> (+0.27%) ⬆️
OS-Linux 97.52% <100.00%> (+0.25%) ⬆️
OS-Windows 95.90% <100.00%> (+1.10%) ⬆️
OS-macOS 97.19% <100.00%> (+0.26%) ⬆️
Py-3.10.11 97.33% <100.00%> (+0.29%) ⬆️
Py-3.10.14 97.26% <100.00%> (+0.28%) ⬆️
Py-3.11.9 97.49% <100.00%> (+0.27%) ⬆️
Py-3.12.4 97.61% <100.00%> (+0.29%) ⬆️
Py-3.8.10 95.54% <100.00%> (+1.13%) ⬆️
Py-3.8.18 97.05% <100.00%> (+0.28%) ⬆️
Py-3.9.13 97.20% <100.00%> (+0.28%) ⬆️
Py-3.9.19 97.14% <100.00%> (+0.27%) ⬆️
Py-pypy7.3.16 96.73% <100.00%> (+0.27%) ⬆️
VM-macos 97.19% <100.00%> (+0.26%) ⬆️
VM-ubuntu 97.52% <100.00%> (+0.25%) ⬆️
VM-windows 95.90% <100.00%> (+1.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco
Copy link
Member

bdraco commented Aug 14, 2024

Maybe this should get a changelog message as a breaking change

It does look like its used externally https://github.com/Starry-OvO/aiotieba/blob/1018eb96f26e6c17b7503f3457ad0accc2a9eb35/aiotieba/core/http.py#L135

some more on github code search https://github.com/search?q=content_disposition_header+aiohttp&type=code&p=2

@Dreamsorcerer Dreamsorcerer removed the bot:chronographer:skip This PR does not need to include a change note label Aug 14, 2024
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Aug 14, 2024
@Dreamsorcerer
Copy link
Member Author

some more on github code search https://github.com/search?q=content_disposition_header+aiohttp&type=code&p=2

Most of the results are just forks of aiohttp. I can see one which already passes params as a dict in the second argument, which wouldn't even work with the old code...

@Dreamsorcerer Dreamsorcerer merged commit 28cb7d7 into master Aug 14, 2024
37 of 38 checks passed
@Dreamsorcerer Dreamsorcerer deleted the Dreamsorcerer-patch-4 branch August 14, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip Skip backport bot bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants