Хорошо, теперь я работаю над простым приложением с колбой, и оно работает, но во время работы мне понадобился ipdb для определенного API, после того, как я его добавил
Traceback (most recent call last):
File "/home/amir/Workspace/mmb/recsysenv/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
.
.
.
File "/usr/local/lib/python3.6/bdb.py", line 51, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/local/lib/python3.6/bdb.py", line 69, in dispatch_line
self.user_line(frame)
File "/usr/local/lib/python3.6/pdb.py", line 261, in user_line
self.interaction(frame, None)
File "/home/amir/Workspace/mmb/recsysenv/lib/python3.6/site-packages/IPython/core/debugger.py", line 294, in interaction
OldPdb.interaction(self, frame, traceback)
File "/usr/local/lib/python3.6/pdb.py", line 352, in interaction
self._cmdloop()
File "/usr/local/lib/python3.6/pdb.py", line 321, in _cmdloop
self.cmdloop()
File "/home/amir/Workspace/mmb/recsysenv/lib/python3.6/site-packages/IPython/terminal/debugger.py", line 97, in cmdloop
line = self.pt_app.prompt() # reset_current_buffer=True)
File "/home/amir/Workspace/mmb/recsysenv/lib/python3.6/site-packages/prompt_toolkit/shortcuts/prompt.py", line 986, in prompt
return self.app.run()
File "/home/amir/Workspace/mmb/recsysenv/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 788, in run
return get_event_loop().run_until_complete(self.run_async(pre_run=pre_run))
File "/usr/local/lib/python3.6/asyncio/events.py", line 694, in get_event_loop
return get_event_loop_policy().get_event_loop()
File "/usr/local/lib/python3.6/asyncio/events.py", line 602, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'Thread-1'.
После этого я добавил фрагмент потока, подобный этому, нафайл фляги
from threading import Thread
t = Thread(target=app, args=())
t.daemon = True
t.start()
t.join()
if __name__ == '__main__':
app.run()
но он поднимается
Traceback (most recent call last):
File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
TypeError: __call__() missing 2 required positional arguments: 'environ' and 'start_response'
Я пробовал как режим отладки, так и режим не отладки