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

request.remote should work on closed transport #2474

Closed
asvetlov opened this issue Nov 7, 2017 · 2 comments
Closed

request.remote should work on closed transport #2474

asvetlov opened this issue Nov 7, 2017 · 2 comments
Labels
Milestone

Comments

@asvetlov
Copy link
Member

asvetlov commented Nov 7, 2017

Regression, should be fixed on 2.3 branch also.

aiohttp/pytest_plugin.py:119: RuntimeError
-------------------------------------------------- Captured stderr call --------------------------------------------------
Error handling request
Traceback (most recent call last):
  File "/home/andrew/projects/aiohttp/aiohttp/web_protocol.py", line 414, in start
    resp = await self._request_handler(request)
  File "/home/andrew/projects/aiohttp/aiohttp/web.py", line 309, in _handle
    resp = await handler(request)
  File "/home/andrew/projects/aiohttp/tests/test_client_ws_functional.py", line 759, in handler
    await ws.receive_bytes()
  File "/home/andrew/projects/aiohttp/aiohttp/web_ws.py", line 326, in receive_bytes
    msg.data))
TypeError: Received message 8:1000 is not bytes
Error in logging
Traceback (most recent call last):
  File "/home/andrew/projects/aiohttp/aiohttp/helpers.py", line 510, in __get__
    return inst._cache[self.name]
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andrew/projects/aiohttp/aiohttp/helpers.py", line 477, in log
    for key, value in fmt_info:
  File "/home/andrew/projects/aiohttp/aiohttp/helpers.py", line 469, in <genexpr>
    for key, method in self._methods)
  File "/home/andrew/projects/aiohttp/aiohttp/helpers.py", line 429, in _format_a
    ip = request.remote
  File "/home/andrew/projects/aiohttp/aiohttp/helpers.py", line 512, in __get__
    val = self.wrapped(inst)
  File "/home/andrew/projects/aiohttp/aiohttp/web_request.py", line 318, in remote
    peername = self.transport.get_extra_info('peername')
AttributeError: 'NoneType' object has no attribute 'get_extra_info'
@asvetlov asvetlov added this to the 3.0 milestone Nov 7, 2017
@asvetlov
Copy link
Member Author

asvetlov commented Feb 9, 2018

Fixed by 397c042

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant