Occasional Queue.Empty exception in kivy-twisted reactor

18 views
Skip to first unread message

Roman

unread,
Jul 21, 2016, 9:34:48 AM7/21/16
to Kivy users support
Hi,
I have a Kivy app using twisted as well. It's done in the same way as the official example Using Twisted inside Kivy, but every now and then it exits with this exception:

Traceback (most recent call last):
 
File "/home/kivy/beerctrl/src/.buildozer/android/app/mobile/commapp.py", line 5260, in run
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/app.py", line 828, in run
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 487, in runTouchApp
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/window_pygame.py", line 403, in mainloop
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/window_pygame.py", line 290, in _mainloop
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 327, in idle
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/clock.py", line 515, in tick
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/clock.py", line 647, in _process_events
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/clock.py", line 406, in tick
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/support.py", line 204, in reactor_work
 
File "/lib/python2.7/site-packages/twisted/internet/_threadedselect.py", line 228, in _interleave
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/Queue.py", line 190, in get_nowait
 
File "/home/kivy/beerctrl/src/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/Queue.py", line 165, in get
Empty

I tried to go through all the files to see if there is a way to catch it without the program to end, but I haven't found a nice way to do that.
I am not sure why it happens in the first place, it happens only sometimes and it almost seems like a poor wi-fi connection plays a part as well.

Is there a way to avoid this exception? Any experience on why does it occur? I was also thinking about some catching along the way (for example in kivy base or clock modules), but I believe I could mess things up even more.

I cannot provide source code as it's a legal property of a company I work for. Using Python 2.7, Kivy 1.9.2 and Twisted 13.2.0.

Roman

unread,
Jul 22, 2016, 4:21:38 AM7/22/16
to Kivy users support
UPDATE:
I managed to catch this exception using ExceptionHandler in kivy, but I have yet to find out if ignoring this exception can result in any unpredicted behaviour.

I could still use some help or at least opinions on the cause of this exception in the first place and how to prevent it from happening (if possible).
Reply all
Reply to author
Forward
0 new messages