Skip to content

Preparing a websocket from a low-level-server request fails #2024

Closed
@jhrmnn

Description

A request from a low-level server does not have the app attribute, but web.WebSocketResponse.prepare() takes the event loop from BaseRequest.app.loop.

  File ".../aiohttp/web_ws.py", line 103, in _pre_start
    self._loop = request.app.loop
AttributeError: 'BaseRequest' object has no attribute 'app'

I was able to fix this by assigning a mock app to the request, which has a single loop attribute.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions