File->open->.leo doesn't work on using pythonw

37 views
Skip to first unread message

刘 烨东

unread,
Apr 28, 2012, 9:53:59 AM4/28/12
to leo-editor
OS: win32
python: python3.2.2, CPython
gui: PyQt4
leo: leo-4.10-final

When I run leo by '.../python32/python.exe .../leo-4.10-final/
launchLeo.py', [File]->[Open]->[choose-one.leo], it works.
But it doesn't work when using '.../python32/pythonw.exe .../leo-4.10-
final/launchLeo.py'. There is nothing shown in log pane.

I try to trace it, and found a Exception occurred in pr(*args, **keys)
[at leoGlobals.py]:
if print_immediately:
# Good for debugging: prints messages immediately.
sys.stdout.write(s2)
else:
# Good for production: queues 'reading settings' until after
signon.
if app.logInited:
sys.stdout.write(s2) ### Get here, but sys.stdout is None
else:
app.printWaiting.append(s2)

Finally,
1) After I change c.config.redirect_execute_script_output_to_log_pane
to True, it works.
2) change 'sys.stdout.write(s2)' to 'if sys.stdout is not None:
sys.stdout.write(s2)', it works too.

-- sean

Edward K. Ream

unread,
Nov 13, 2012, 6:19:02 AM11/13/12
to leo-e...@googlegroups.com
On Saturday, April 28, 2012 8:53:59 AM UTC-5, sean wrote:

1) After I change c.config.redirect_execute_script_output_to_log_pane
to True, it works.
2) change 'sys.stdout.write(s2)' to 'if sys.stdout is not None:
sys.stdout.write(s2)', it works too.

Thanks for this.  

The fix, based on (2), is on the trunk at rev 5504.

Edward
Reply all
Reply to author
Forward
0 new messages