Cannot run Leo using pythonw, but I can using python

78 views
Skip to first unread message

xgid

unread,
Aug 4, 2017, 7:51:15 PM8/4/17
to leo-editor
Ups! Now that I've just updated to the last commit at GitHub (ca18e51063a9) to fix the issues with the leoBridge (which is working great!), I've found that my usual command line to open Leo is not working any more:

pythonw.exe "C:\dev\Leo-5.4\launchLeo.py" --session-save --session-restore

But if I change it to this one:
python.exe "C:\dev\Leo-5.4\launchLeo.py" --session-save --session-restore

It works!

My current configuration is this one (shown when run with python.exe, of course):
Leo Log Window
Leo 5.5, build 20170804155810, Fri Aug  4 15:58:10 CDT 2017
Git repo info: branch = master, commit = ca18e51063a9
Python 3.6.1, PyQt version 5.6.2
Windows 10 AMD64 (build 10.0.15063) SP0
isPython3: True
caching enabled

The problem is that when using "pythonw.exe" I see no logs at all. Is there a way to enable them?

xgid

unread,
Aug 4, 2017, 7:53:55 PM8/4/17
to leo-editor
Oh, it maybe an important detail: with pythonw the Leo icon splash screen is shown for a second or less, and then it closes and nothing more appears.

Edward K. Ream

unread,
Aug 10, 2017, 6:07:47 AM8/10/17
to leo-editor
On Fri, Aug 4, 2017 at 6:53 PM, xgid <xgdo...@gmail.com> wrote:
Oh, it maybe an important detail: with pythonw the Leo icon splash screen is shown for a second or less, and then it closes and nothing more appears.

​I see exactly the behaviour you describe.  In particular, ​the following works from a Windows console:

c:\Anaconda2\pythonw.exe launchLeo.py

The following briefly shows the the splash screen, and then exits quickly without a message:

c:\Anaconda3\pythonw.exe launchLeo.py

Presumably, this is executing:

Leo 5.5, build 20170810044742, Thu Aug 10 04:47:42 CDT 2017
Git repo info: branch = master, commit = 87480fe2f5cf
Python 3.5.2, PyQt version 5.6.2

Windows 10 AMD64 (build 10.0.15063) SP0

So this looks like a problem with pythonw itself, not with aliases, etc.

Googling pythonw.exe problems does not show anything that immediately seems helpful. There are discussions about "pythonw has stopped working", but that would exit much more slowly. It's a mystery.

Edward

xgid

unread,
Aug 10, 2017, 7:42:38 PM8/10/17
to leo-editor

​I see exactly the behaviour you describe.  In particular, ​the following works from a Windows console:

Glad to see that I'm not the only one with this kind of weird problems with pythonw. If you remember, I had already previously seen differences in the way Leo was printing messages to the Log pane when used with pythonw in respect to using python. So there seems to be something hidden there... quite difficult to detect!

For the record, in this case I have removed ALL my python installations and reinstalled a fresh new Anaconda 4.4.0 installation (Python 3.6.1) from scratch, but the problem persists.

Is there an easy way to get Console output logs when using pythonw? I would like to compare the logs between using pythonw and using python to see where does exactly the former exit.

Xavier

Edward K. Ream

unread,
Aug 11, 2017, 5:52:25 AM8/11/17
to leo-editor
On Thu, Aug 10, 2017 at 6:42 PM, xgid <xgdo...@gmail.com> wrote:
Is there an easy way to get Console output logs when using pythonw?

​I suspect that pythonw is doing something with sys.stdout/stderr.  That might be causing Leo to crash (softly) during startup.

Perhaps Leo should have a new command-line option that would send all log output to a file.

Another idea would be for Leo to be more careful about catching exceptions during startup.

Please file a bug report about this.  With these two new ideas I may be able to fix it.

Edward

xgid

unread,
Aug 13, 2017, 8:18:35 AM8/13/17
to leo-editor

Please file a bug report about this.  With these two new ideas I may be able to fix it.

tfer

unread,
Aug 14, 2017, 10:23:31 AM8/14/17
to leo-editor
Neovim uses Msgpack-rpc that can use different channels to communicate with a "server" on it's embedding app, the lowest channel is via stout/sterr, so the option to leave those clear might be useful to handing the editing of body text to Neovim.

Tom

tfer

unread,
Aug 14, 2017, 10:25:04 AM8/14/17
to leo-editor
opps, "server" or it's embedding app...
Reply all
Reply to author
Forward
0 new messages