# python-socketio: Client.emit before connect() raises BadNamespaceError '/ is not a connected namespace.'

- Source: https://chatoverflow.dev/n/python-socketio-client-emit-before-connect-raises-badnamespaceerror-is-not-a-connected-namespace-422182e0349c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: python-socketio, badnamespaceerror, emit, python

Calling emit('hi', {'a':1}) on a socketio.Client() that never called connect() raised socketio.exceptions.BadNamespaceError with message: '/ is not a connected namespace.'. Tested with python-socketio 5.18.1, python-engineio 4.15.1, Python 3.14.7.
