Leo not running with pythonw.exe

126 views
Skip to first unread message

Terry

unread,
Jul 15, 2016, 12:07:11 PM7/15/16
to leo-e...@googlegroups.com
Problem: Leo does not run when launched with pythonw.exe. Appears to run fine with python.exe but has starting messages (see output below)

platform : win-64
python version : 3.5.2.final.0
Leo is installed with: LeoSetup-5.3-final.exe

Launching with python.exe:


C
:\Users\terry\AppData\Local\Continuum\Miniconda3\python.exe "C:\Program Files (x86)\Leo-5.3-final\launchLeo.py"

leoID=6857 (in C:\Users\terry\.leo)
reading settings in C:\Program Files (x86)\Leo-5.3-final\leo\config\leoSettings.leo
reading settings in C:\Users\terry\.leo\myLeoSettings.leo
@openwith lines must start with a tag: 'subprocess.Popen',['pythonw','C:/Python24/Lib/idlelib/idle.pyw'],'.py'
@openwith lines must start with a tag: 'subprocess.Popen','C:/Program Files/Microsoft Office/Office/WINWORD.exe',None
conflicting key bindings in myLeoSettings.leo
   all Ctrl+Shift+Key-0 delete-comments
   all Ctrl+Shift+Key-0 delete-comments
Failed to load libEGL (The specified module could not be found.)
QWindowsEGLStaticContext::create: Failed to load and resolve libEGL functions
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
reading settings in C:\Users\terry\.leo\harry.leo

** isPython3: True
Leo 5.3-final, build 20160412153848, Tue Apr 12 15:38:48 CDT 2016
Not running from a git repo
Python 3.5.2, PyQt version 5.6.0
Windows 7 AMD64 (build 6.1.7601) SP1
wrote recent file: C:\Users\terry\.leo\.leoRecentFiles.txt

tfer

unread,
Jul 16, 2016, 6:15:39 AM7/16/16
to leo-editor
From a terminal/console try:
   pythonw .\launchLeo.py  1>stdout.txt 2>stderr.txt

Edward K. Ream

unread,
Jul 16, 2016, 8:02:26 AM7/16/16
to leo-editor
​​
On Sat, Jul 16, 2016 at 5:15 AM, 'tfer' via leo-editor <leo-e...@googlegroups.com> wrote:
From a terminal/console try:
 
​​
 pythonw
​​
.\launchLeo.py  1>stdout.txt 2>stderr.txt



​Thanks for this.  It does work for me on Windows 10.  For example:

from __future__ import print_function # python 2.x.
import sys
for i in range(10):
    print(i, file=sys.stderr)

It would best if Leo worked out of the box with pythonw without the need for redirection.  I'll look into it.  This should be feasible: most calls to stdout/stderr happen from just a few places: g.es, g.es_print, etc., which funnel into g.pr.

Edward

Edward K. Ream

unread,
Jul 16, 2016, 8:54:30 AM7/16/16
to leo-editor
On Sat, Jul 16, 2016 at 7:02 AM, Edward K. Ream <edre...@gmail.com> wrote:

​> ​
It would best if Leo worked out of the box with pythonw without the need for redirection.

​There are two parts to the solution:​

​1. ​
sys.stdout & sys.stderr should send to to dev/nul or its equivalent if they don't exist
​ on startup.​
​ I assume this happens when using pythonw.exe
​with no command-line redirection of stdout or stderr.

2. g.es and g.pr should send all messages exactly once to the log pane. This may be a bit tricky. We could also imagine new stderr or stdout panes in the log window, but this is not essential.

Only point 1 is urgent.

Edward

Terry

unread,
Jul 18, 2016, 10:00:49 AM7/18/16
to leo-e...@googlegroups.com
Nothing happens.
I'm suspecting maybe the process just crashes on the Qt issue I marked in red?

Edward K. Ream

unread,
Jul 18, 2016, 12:04:37 PM7/18/16
to leo-editor
On Mon, Jul 18, 2016 at 9:00 AM, Terry <webto...@gmail.com> wrote:
Nothing happens.
I'm suspecting maybe the process just crashes on the Qt issues ?

Rev 9d28e6c fixes this, at least on Windows 10.

All the new code is in LM.setStdStreams, which sends stderr and/or stdout to the log pane if they don't exist.

For debugging this code it's essential to redirect stderr to a file.  On windows this would be done with 2>stderr.txt. You can't even use pdb.set_trace because sys.stdin does not exist.

This is exceptionally tricky code.  The key difference between g.es and LeoStdOut.write is setting from_redirect=True in the call to log.put in LeoStdOut.write.  This suppresses unwanted newlines when calling print.  It also allows the 'end' keyword argument to be handled properly in calls to print.

All unit tests pass, but not tested yet on Linux. Let me know if there problems.

Edward

Terry

unread,
Jul 21, 2016, 12:04:30 PM7/21/16
to leo-editor

the fix is not in the "latest" (https://github.com/leo-editor/leo-editor/archive/master.zip)
 >>> Leo 5.4-devel, build 20160412153848

is it ?

If not how can I get it ?

BTW Python crashes upon Leo start

Edward K. Ream

unread,
Jul 21, 2016, 12:17:16 PM7/21/16
to leo-editor
On Thu, Jul 21, 2016 at 11:04 AM, Terry <webto...@gmail.com> wrote:
>
> the fix is not in the "latest"


The latest is f329acf. Not sure where the other rev number came from.

This works for me on both Linux and Windows 10.

EKR

Terry

unread,
Jul 25, 2016, 4:12:37 PM7/25/16
to leo-editor
Why is it you don't seem to want to support Windows 7 ?
I'd bet my left ear that W7 has far, far more installations than W10.....

Edward K. Ream

unread,
Jul 25, 2016, 5:27:22 PM7/25/16
to leo-editor
On Mon, Jul 25, 2016 at 3:12 PM, Terry <webto...@gmail.com> wrote:
> Why is it you don't seem to want to support Windows 7 ?
> I'd bet my left ear that W7 has far, far more installations than W10.....

Windows 10 is what I have, but afaik anything that work on 10 should
work on 7. Do you know of any incompatibilities?

EKR

Terry

unread,
Jul 28, 2016, 4:48:02 PM7/28/16
to leo-editor
Ed,

I feel like we're starting to go in circles....

Let me be clear: I don't know Git - unfortunately, I don't have it.
I've been getting Leo from the links on the Download page http://leoeditor.com/download.html
So please - let me know where/how to get Leo with the "f329acf" fix

thanks

Edward K. Ream

unread,
Jul 28, 2016, 5:02:32 PM7/28/16
to leo-editor


On Thu, Jul 28, 2016 at 3:48 PM, Terry <webto...@gmail.com> wrote:

> Let me be clear: I don't know Git - unfortunately, I don't have it.

If you want to be sure that you have a particular git commit, then installing git is the most direct way.


> I've been getting Leo from the links on the Download page
> http://leoeditor.com/download.html

​T​
he snapshots part of the downloads page
​ should contain the commit you want.​
​ ​
Th
​is commit was pushed several days ago, so the 1 day ago link should incorporate the desired code.

EKR

Terry Brown

unread,
Jul 28, 2016, 5:18:50 PM7/28/16
to leo-e...@googlegroups.com
On Thu, 28 Jul 2016 13:48:02 -0700 (PDT)
Terry <webto...@gmail.com> wrote:

> Ed,
>
> I feel like we're starting to go in circles....
>
> Let me be clear: I don't know Git - unfortunately, I don't have it.
> I've been getting Leo from the links on the Download
> page http://leoeditor.com/download.html
> So please - let me know where/how to get Leo with the "f329acf" fix

From the bottom of that page:

Here are some direct download links:

Latest <====
1 day ago
2 days ago
5 days ago
10 days ago
30 days ago
90 days ago

the arrowed link is always the most recent Leo, and it's just a .zip
file, not gitness needed.

Cheers -Terry

lewis

unread,
Jul 30, 2016, 7:51:08 AM7/30/16
to leo-editor

If you don't run git, you can also go to https://github.com/leo-editor/leo-editor/commits/master
and download the "f329acf" commit. Hope it helps.

Lewis
Reply all
Reply to author
Forward
0 new messages