aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Add missing __repr__ to streams.EmptyStreamReader

Open elonen opened this issue 3 years ago • 1 comments

EmptyStreamReader currently inherits __repr__ from StreamReader , which then tries to access non-existing fields, causing AttributeErrors. The bug causes issues like this in upstream code: https://github.com/miguelgrinberg/python-socketio/issues/1032

This PR adds a custom __repr__ to EmptyStreamReader to fix the problem.

elonen avatar Sep 15 '22 16:09 elonen

Codecov Report

Merging #6916 (ae9e897) into master (52fa599) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #6916   +/-   ##
=======================================
  Coverage   97.41%   97.41%           
=======================================
  Files         106      106           
  Lines       30879    30882    +3     
  Branches     3843     3843           
=======================================
+ Hits        30081    30084    +3     
  Misses        600      600           
  Partials      198      198           
Flag Coverage Δ
CI-GHA 97.32% <100.00%> (+<0.01%) :arrow_up:
OS-Linux 96.97% <100.00%> (-0.01%) :arrow_down:
OS-Windows 95.42% <100.00%> (+<0.01%) :arrow_up:
OS-macOS 96.59% <100.00%> (-0.01%) :arrow_down:
Py-3.10.6 96.71% <100.00%> (-0.42%) :arrow_down:
Py-3.10.7 96.85% <100.00%> (+1.61%) :arrow_up:
Py-3.11.0-rc.2 96.49% <100.00%> (-0.05%) :arrow_down:
Py-3.7.13 96.80% <100.00%> (+<0.01%) :arrow_up:
Py-3.7.9 95.31% <100.00%> (+<0.01%) :arrow_up:
Py-3.8.10 95.21% <100.00%> (+<0.01%) :arrow_up:
Py-3.8.13 96.75% <100.00%> (+<0.01%) :arrow_up:
Py-3.9.13 97.04% <100.00%> (-0.03%) :arrow_down:
Py-3.9.14 96.47% <100.00%> (?)
Py-pypy7.3.9 96.34% <100.00%> (-0.01%) :arrow_down:
VM-macos 96.59% <100.00%> (-0.01%) :arrow_down:
VM-ubuntu 96.97% <100.00%> (-0.01%) :arrow_down:
VM-windows 95.42% <100.00%> (+<0.01%) :arrow_up:

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

Impacted Files Coverage Δ
aiohttp/streams.py 97.46% <100.00%> (+0.01%) :arrow_up:
tests/test_streams.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 15 '22 21:09 codecov[bot]

Backport to 3.9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.9/abafcdac6cbef06bc555cb77b1ebe724d2a098ec/pr-6916

Backported as https://github.com/aio-libs/aiohttp/pull/7106

🤖 @patchback I'm built with octomachinery and my source is open — https://github.com/sanitizers/patchback-github-app.

patchback[bot] avatar Nov 28 '22 19:11 patchback[bot]