miguelgrinberg / Flask-SocketIO

Socket.IO integration for Flask applications.
MIT License
5.36k stars 890 forks source link

Server.call() has invalid argument #1953

Closed miguelgrinberg closed 1 year ago

miguelgrinberg commented 1 year ago

Discussed in https://github.com/miguelgrinberg/Flask-SocketIO/discussions/1952

Originally posted by **P-T-I** March 17, 2023 I get the following error: ``` flask_ws_3 | Traceback (most recent call last): flask_ws_3 | File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner flask_ws_3 | self.run() flask_ws_3 | File "/usr/lib/python3.10/threading.py", line 953, in run flask_ws_3 | self._target(*self._args, **self._kwargs) flask_ws_3 | File "/usr/local/lib/python3.10/dist-packages/socketio/server.py", line 733, in _handle_event_internal flask_ws_3 | r = server._trigger_event(data[0], namespace, sid, *data[1:]) flask_ws_3 | File "/usr/local/lib/python3.10/dist-packages/socketio/server.py", line 758, in _trigger_event flask_ws_3 | return self.handlers[namespace][event](*args) flask_ws_3 | File "/usr/local/lib/python3.10/dist-packages/flask_socketio/__init__.py", line 282, in _handler flask_ws_3 | return self._handle_event(handler, message, namespace, sid, flask_ws_3 | File "/usr/local/lib/python3.10/dist-packages/flask_socketio/__init__.py", line 826, in _handle_event flask_ws_3 | ret = handler(*args) flask_ws_3 | File "/app/display/webapp/home/websockets.py", line 167, in do_change_display_tab flask_ws_3 | call( flask_ws_3 | File "/usr/local/lib/python3.10/dist-packages/flask_socketio/__init__.py", line 946, in call flask_ws_3 | return socketio.call(event, *args, namespace=namespace, to=to, flask_ws_3 | File "/usr/local/lib/python3.10/dist-packages/flask_socketio/__init__.py", line 495, in call flask_ws_3 | return self.server.call(event, *args, namespace=namespace, to=to, flask_ws_3 | TypeError: Server.call() got an unexpected keyword argument 'include_self' ``` Running Flask-SocketIO 5.3.2
miguelgrinberg commented 1 year ago

@P-T-I this fixes the include_self error. Can I ask you to install the main branch of this package and confirm that the issue is addressed? Thanks!

Install with pip install git+https://github.com/miguelgrinberg/flask-socketio

P-T-I commented 1 year ago

@miguelgrinberg I can confirm this solves the issue! Thank you for your swift reply! Are you pushing a new release soon?

miguelgrinberg commented 1 year ago

Yes, a new release will be out soon.