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 aiohttp disconnect error on websockets #2806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

s22chan
Copy link

@s22chan s22chan commented Oct 27, 2024

aiohttp will throw if the handler doesn't return anything.

14:11:35 aiohttp ERRO Missing return statement on request handler
Traceback (most recent call last):
  File "/Users/steve/conda/envs/port/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 653, in finish_response
    prepare_meth = resp.prepare
                   ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'prepare'

Fixes #2805

https://docs.aiohttp.org/en/stable/web_quickstart.html#websockets

Pull Request Checklist

  • Description which clearly states what problems the PR solves.
  • Description contains a link to the Github Issue, and any relevent
    Discussions, this PR applies to.
  • Include new tests that fail without this PR but passes with it.
  • Include any relevent Documentation changes related to this change.
  • Verify all commits have been signed in accordance with the DCO policy.
  • Reviewed PR commit history to remove unnecessary changes.
  • Make sure your PR passes build, test and lint steps completely.

aiohttp will throw if the handler doesn't return anything.

```python
14:11:35 aiohttp ERRO Missing return statement on request handler
Traceback (most recent call last):
  File "/Users/steve/conda/envs/port/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 653, in finish_response
    prepare_meth = resp.prepare
                   ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'prepare'
```

https://docs.aiohttp.org/en/stable/web_quickstart.html#websockets
Signed-off-by: Steve Chan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aiohttp handler: 'NoneType' object has no attribute 'prepare'
1 participant