leo-editor / leo-editor

Leo is an Outliner, Editor, IDE and PIM written in 100% Python.
https://leo-editor.github.io/leo-editor/
Other
1.49k stars 156 forks source link

AttributeError: type object 'IOLoop' has no attribute '_current' (leoflexx.py) #1103

Closed LewisNeal closed 5 years ago

LewisNeal commented 5 years ago

Trying to use the mod_http plugin I am getting an 'unable to connect' error at http://localhost:8130/

I've checked myLeoSettings file and it meets all the requirements to run the plugin.

This problem occurred while I had a stalled leoflexx session.

Running leoflexx.py I get:

Traceback (most recent call last):
  File "N:\git\leo-editor\launchLeo.py", line 8, in <module>
    leo.core.runLeo.run()
  File "N:\git\leo-editor\leo\core\runLeo.py", line 72, in run
    g.app.loadManager.load(fileName, pymacs)
  File "N:\git\leo-editor\leo\core\leoApp.py", line 2294, in load
    g.app.gui.runMainLoop()
  File "N:\git\leo-editor\leo\plugins\leoflexx.py", line 1225, in runMainLoop
    flx.launch(LeoBrowserApp, runtime)
  File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_funcs.py", line 229, in launch
    return a.launch(runtime, **runtime_kwargs)
  File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_app.py", line 151, in launch
    current_server()
  File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_server.py", line 78, in current_server
    create_server()
  File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_server.py", line 59, in create_server
    _current_server = TornadoServer(host, port, loop, **server_kwargs)
  File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_tornadoserver.py", line 56, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_server.py", line 118, in
__init__
    self._open(host, port, **kwargs)
  File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app\_tornadoserver.py", line 70, in _open
    IOLoop._current.instance = None
AttributeError: type object 'IOLoop' has no attribute '_current'
LewisNeal commented 5 years ago

Sorry I didn't include the complete log. Here is the first half :

Empty setting name in False set parent @settings extractExecutableString rest rest extractExecutableString rest python extractExecutableString rest rest extractExecutableString rest python [I 13:24:03 flexx.app] Asset store collected 2 new modules. Leo 5.8.1-b2 devel, build 20190227233831, Wed Feb 27 23:38:31 PST 2019 livecode.py: can not import meta pip install meta Traceback (most recent call last):

File "N:\git\leo-editor\leo\core\leoPlugins.py", line 515, in loadOnePluginHelper import(moduleName)

File "N:\git\leo-editor\leo\plugins\attrib_edit.py", line 427, in class ListDialog(QtWidgets.QDialog):

NameError: name 'QtWidgets' is not defined

Traceback (most recent call last):

File "N:\git\leo-editor\leo\core\leoPlugins.py", line 479, in callInitFunction init_result = result.init()

File "N:\git\leo-editor\leo\plugins\helloWorld.py", line 29, in init errorList.append('helloWorld requires PyQt as the Leo-Editor Graphical User Interface.')

NameError: name 'errorList' is not defined

rss.py: can not import feedparser livecode.py: can not import meta pip install meta Traceback (most recent call last):

File "N:\git\leo-editor\leo\core\leoPlugins.py", line 515, in loadOnePluginHelper import(moduleName)

File "N:\git\leo-editor\leo\plugins\attrib_edit.py", line 427, in class ListDialog(QtWidgets.QDialog):

NameError: name 'QtWidgets' is not defined

Traceback (most recent call last):

File "N:\git\leo-editor\leo\core\leoPlugins.py", line 479, in callInitFunction init_result = result.init()

File "N:\git\leo-editor\leo\plugins\helloWorld.py", line 29, in init errorList.append('helloWorld requires PyQt as the Leo-Editor Graphical User Interface.')

NameError: name 'errorList' is not defined

edreamleo commented 5 years ago

@LewisNeal I'll investigate, but I'm not sure that mod_http is compatible with LeoWapp.

LewisNeal commented 5 years ago

I don't mind that mod_http may not be compatible with LeoWapp. This report is about LeoWapp / leoflexx.py not starting. So to reproduce I removed mod_http in myLeoSettings file. Then ran command: python N:\git\leo-editor\leo\plugins\leoflexx.py --flexx-webruntime=browser

I still receive error: [snip] _File "C:\Users\lewis\AppData\Local\Programs\Python\Python37\lib\site-packages\flexx\app_tornadoserver.py", line 70, in _open IOLoop._current.instance = None AttributeError: type object 'IOLoop' has no attribute 'current'

edreamleo commented 5 years ago

@LewisNeal Thanks for the clarification. This crash is not in Leo, so I doubt that Leo can do anything about it. It may be a problem with your installation.

I am going to leave this item open, but I am going to remove the 5.8.1 milestone.

LewisNeal commented 5 years ago

I downgraded from tornado 6.0.2 back to 5.0: pip3 install tornado==5

Now leoflexx.py works again :/ See stackoverflow flexx-attributeerror-type-object-ioloop-has-no-attribute-current

LewisNeal commented 5 years ago

oops, I didn't mean to close the issue. Reopened

edreamleo commented 5 years ago

@LewisNeal I am going to close this issue. Please file a flexx bug report. I don't believe there is anything Leo can do about a crash in flexx's main loop ;-)

LewisNeal commented 5 years ago

Fixed in Flexx 0.8 release. Issue 555