You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
Using python-osc in my app I noticed a strange behavior related to the dispatcher. When I map a function to a path without using wildcards in the path, e.g. this way: dispatcher.map('/qwer/asdf/zxcv', func)
the function is called obviously only when full path matches. But when I map a string this way: dispatcher.map('/qwer/*/zxcv', func)
it matches not only all paths like: /qwer/whatever/zxcv, but also such ones like this: /qwer/whatever/zxcvsomethingmore.
I'm not sure whether it is correct mechanism and the problem is lack of my understanding of the OSC protocol or is it a bug. I noticed in the dispatcher's code, that in function handlers_for_addresses, in line 211, there is a variable addr used as a pattern, without added $ sign at the end, while in line 209 the pattern is ended with this sign (added in line 204).
The OSC protocol doesn't mention if * has greedy matching or not, but regardless this looks like a bug, first step should be to reproduce that behavior in the test_dispatcher.py file then fixing it shouldn't be too hard. Contributions are welcome if you have time for it :)
Hi
Using python-osc in my app I noticed a strange behavior related to the dispatcher. When I map a function to a path without using wildcards in the path, e.g. this way:
dispatcher.map('/qwer/asdf/zxcv', func)
the function is called obviously only when full path matches. But when I map a string this way:
dispatcher.map('/qwer/*/zxcv', func)
it matches not only all paths like: /qwer/whatever/zxcv, but also such ones like this: /qwer/whatever/zxcvsomethingmore.
I'm not sure whether it is correct mechanism and the problem is lack of my understanding of the OSC protocol or is it a bug. I noticed in the dispatcher's code, that in function handlers_for_addresses, in line 211, there is a variable addr used as a pattern, without added $ sign at the end, while in line 209 the pattern is ended with this sign (added in line 204).
python-osc/pythonosc/dispatcher.py
Line 117 in 66dc211
The text was updated successfully, but these errors were encountered: