Question on event names in gevent-socketio

47 views
Skip to first unread message

Gareth Gale

unread,
Jan 24, 2014, 8:24:17 AM1/24/14
to gevent-...@googlegroups.com
Hi,

I've just started using gevent-socketio - very nice.

I'm seeing an error however when using certain strings for event names - the error being raised is "unallowed_event_name".

Looking on the web, I see certain characters are not permitted. For example, https://sourcegraph.com/github.com/abourget/gevent-socketio/symbols/python/socketio/namespace/BaseNamespace/error contains this section :-

if not allowed_event_name_regex.match(name):
            self.error("unallowed_event_name",
                       "name must only contains alpha numerical characters")

The error is caused when my client uses something like this :-

socket.emit('badly-named-event', $('#message').val());

I think it's the hyphen characters (-). Is there a list of illegal characters somewhere I can reference ?

Thanks in advance !

Alexandre Bourget

unread,
Jan 24, 2014, 9:58:33 AM1/24/14
to gevent-...@googlegroups.com
You have that allowed_event_name_regex in namespace.py:

allowed_event_name_regex = re.compile(r'^[A-Za-z][A-Za-z0-9_ ]*$')

So indeed, hyphens aren't allowed. Spaces are allowed, and are later translated to '_'.


Alexandre


--
You received this message because you are subscribed to the Google Groups "gevent-socketio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gevent-socket...@googlegroups.com.
To post to this group, send email to gevent-...@googlegroups.com.
Visit this group at http://groups.google.com/group/gevent-socketio.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages