quart icon indicating copy to clipboard operation
quart copied to clipboard

app.teardown_websocket no longer exists

Open heuripedes opened this issue 6 months ago • 1 comments

app.teardown_websocket no longer exists in 0.19.x. It was previously implemented in the Scaffold class, the previous base for Quart and Blueprint, which was deleted in commit https://github.com/pallets/quart/commit/598b771abd36fb2d581aa88a64336c88615a26bf

Code to reproduce:

from quart import Quart

app = Quart(__name__)

@app.teardown_websocket
def on_websocket_teardown(*args, **kwargs):
    print("TEARDOWN!!")

app.run()

Traceback:

Traceback (most recent call last):
  File "/home/higor/code/no-teardown-websocket/app.py", line 5, in <module>
    @app.teardown_websocket
AttributeError: 'Quart' object has no attribute 'teardown_websocket'

Expected behavior:

  1. no crash
  2. a function should have been registered as a websocket teardown handler

Environment:

  • Python version: 3.9.18
  • Quart version: 0.19.4

heuripedes avatar Dec 06 '23 20:12 heuripedes