npcole / npyscreen

Automatically exported from code.google.com/p/npyscreen
Other
479 stars 109 forks source link

npyscreen 4.10.5 does not work on python 3.8 #107

Open yhojann-cl opened 3 years ago

yhojann-cl commented 3 years ago

By example:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import npyscreen

class MainForm(npyscreen.FormBaseNew):
    def create(self):
        self.add(npyscreen.BoxTitle, name="BoxTitle")

class MainController(npyscreen.StandardApp):
    def onStart(self):
        self.addForm('MAIN', MainForm, name='Test')

class MainCLS(object):
    def __init__(self):
        mainController = MainController()
        mainController.run()

if __name__ == '__main__':
    MainCLS()

The results:

$ 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