Clean up redundant code and stale comments from PR #11290#11301
Clean up redundant code and stale comments from PR #11290#11301Dreamsorcerer merged 1 commit intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11301 +/- ##
==========================================
- Coverage 98.84% 98.84% -0.01%
==========================================
Files 131 131
Lines 43433 43430 -3
Branches 2331 2331
==========================================
- Hits 42933 42930 -3
Misses 346 346
Partials 154 154
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #11301 will not alter performanceComparing Summary
|
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #11318 🤖 @patchback |
Backport to 3.13: 💚 backport PR created✅ Backport PR branch: Backported as #11319 🤖 @patchback |
… comments from PR #11290 (#11319) **This is a backport of PR #11301 as merged into master (815901f).** Co-authored-by: J. Nick Koston <[email protected]>
… comments from PR #11290 (#11318) **This is a backport of PR #11301 as merged into master (815901f).** Co-authored-by: J. Nick Koston <[email protected]>
What do these changes do?
This PR addresses review comments from PR #11290 by:
IOBasePayload.sizeproperty - the exceptions are already handled by the outer try-exceptAre there changes in behavior for the user?
No behavioral changes. This is purely a code cleanup that removes redundancy while maintaining the exact same functionality.
Is it a substantial burden for the maintainers to support this?
No, this actually reduces maintenance burden by:
Related issue number
Follow-up to #11290 (addressing review comments)
Related to #11270 (original bug fix)
Checklist
CONTRIBUTORS.txtCHANGES/folderSummary of Changes
1. Removed redundant code in
aiohttp/payload.py:The inner try-except was redundant because:
sizeproperty already catchesAttributeErrorandOSErrorself._value.tell()will be caught by the outer handler2. Updated test comments in
tests/test_payload.py:test_iobase_payload_size_after_reading3. Updated test comments in
tests/test_client_functional.py:test_file_upload_307_308_redirectfrom "demonstrates the bug" to "verifies that file payloads maintain correct Content-Length"All tests continue to pass, confirming the redundant code was indeed unnecessary.