I'm running a Python app that interfaces with py_websockets_bot on Mac OS X. Most things are working fine, but I've run into a problem with bot.update(). Calling it generates the following exception:
Traceback (most recent call last):
File "./scratch_to_bot.py", line 210, in <module>
connect_to_scratch_and_stream_commands_to_bot()
File "./scratch_to_bot.py", line 199, in connect_to_scratch_and_stream_commands_to_bot
robot.update()
File "./scratch_to_bot.py", line 180, in update
self.bot.update()
File "/Library/Python/2.7/site-packages/py_websockets_bot/__init__.py", line 687, in update
num_items_to_process = streaming_data.data_queue.qsize()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 139, in qsize
return self._maxsize - self._sem._semlock._get_value()
NotImplementedError
The error is actually in the Python framework. Digging a bit, I found the following:
https://docs.python.org/2/library/multiprocessing.html
qsize()
Return the approximate size of the queue. Because of multithreading/multiprocessing semantics, this number is not reliable.
Note that this may raise NotImplementedError on Unix platforms like Mac OS X where sem_getvalue() is not implemented.
so it appears that the current implementation of update() is incompatible with Mac OS X.
I'm looking for a workaround - my main interest in update() is to keep the camera streaming.
Any ideas?
Thanks
Simon