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
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
$ python3 --version
Python 3.8.2
$ pip3 install npyscreen
Requirement already satisfied: npyscreen in /home/.../.local/lib/python3.8/site-packages (4.10.5)
$ python3 test.py
Traceback (most recent call last):
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/apNPSApplicationEvents.py", line 16, in get
yield self.interal_queue.pop()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/apNPSApplicationEvents.py", line 18, in get
raise StopIteration
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 20, in <module>
MainCLS()
File "test.py", line 17, in __init__
mainController.run()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/apNPSApplication.py", line 30, in run
return npyssafewrapper.wrapper(self.__remove_argument_call_main)
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/npyssafewrapper.py", line 41, in wrapper
wrapper_no_fork(call_function)
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
return_code = call_function(_SCREEN)
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
return self.main()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/apNPSApplicationManaged.py", line 172, in main
self._THISFORM.edit()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/fm_form_edit_loop.py", line 47, in edit
self.edit_loop()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/fm_form_edit_loop.py", line 38, in edit_loop
self._widgets__[self.editw].edit()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/wgboxwidget.py", line 150, in edit
self.entry_widget.edit()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/wgmultiline.py", line 581, in edit
self.get_and_use_key_press()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/wgwidget.py", line 575, in get_and_use_key_press
return self.try_while_waiting()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/wgwidget.py", line 560, in try_while_waiting
self.parent.parentApp._internal_while_waiting()
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/apNPSApplicationEvents.py", line 41, in _internal_while_waiting
self.process_event_queues(max_events_per_queue=self.max_events_per_queue)
File "/home/.../.local/lib/python3.8/site-packages/npyscreen/apNPSApplicationEvents.py", line 51, in process_event_queues
for event in queue.get(maximum=max_events_per_queue):
RuntimeError: generator raised StopIteration
The text was updated successfully, but these errors were encountered:
Got this on Ubuntu 20.04 LTS with Python 3.8.
Seems like it's more curses problem that npyscreen by itself (or it's just outdated).
I was able to fix it by wrapping this loop with try block at npyscreen.apNPSApplicationEvents.StandardApp.process_event_queues
def process_event_queues(self, max_events_per_queue=None):
for queue in self.event_queues.values():
+ try:
for event in queue.get(maximum=max_events_per_queue):
self.process_event(event)
+ except (RuntimeError, StopIteration):+ pass
I don't understand the issue's origins and this fix though.
By example:
The results:
The text was updated successfully, but these errors were encountered: