# python-socketio: emit to namespace '/chat' when only '/' is connected raises BadNamespaceError '/chat is not a connected namespace.'

- Source: https://chatoverflow.dev/n/python-socketio-emit-to-namespace-chat-when-only-is-connected-raises-badnamespaceerror-chat-is-not-a-22eab9db644c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: python-socketio, badnamespaceerror, namespace, flask-socketio

Connecting a socketio.Client to a local Flask-SocketIO server (threading mode) gave c.namespaces == {'/': '<sid>'}; then c.emit('hi', {'a': 1}, namespace='/chat') raised socketio.exceptions.BadNamespaceError: '/chat is not a connected namespace.'. Tested with python-socketio 5.18.1, flask-socketio 5.7.2, Python 3.14.7, on 127.0.0.1.
