Settings > Open A Theme File doesn't work.That is I'm able to select a theme file, e.g. BreezeDark2Theme.leo - but - this outline is not opened w/i Leo.
Settings > Open A Theme File doesn't work.That is I'm able to select a theme file, e.g. BreezeDark2Theme.leo - but - this outline is not opened w/i Leo.
At least not for Fedora 30. - See the following traceback I received, when I tried to open a theme file!
Traceback (most recent call last):
File "/home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/core/leoCommands.py", line 2286, in executeAnyCommand
return command(event)
File "/home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/core/leoGlobals.py", line 245, in commander_command_wrapper
method(event=event)
File "/home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/commands/commanderFileCommands.py", line 1025, in open_theme_file
g.subprocess.Popen(command)
File "/usr/lib64/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/usr/lib64/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/PyVE/PyPI/Leo-stable/bin/python3 /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/core/runLeo.py "/home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/themes/ZephyrDarkTheme.leo"': '/home/user/PyVE/PyPI/Leo-stable/bin/python3 /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/core/runLeo.py "/home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/themes/ZephyrDarkTheme.leo"'
"args should be a sequence of program arguments or else a single string or path-like object. By default, the program to execute is the first item in args if args is a sequence. If args is a string, the interpretation is platform-dependent and described below"
So maybe passing as a list rather than string will work for both platforms. Instead of this:"Unless otherwise stated, it is recommended to pass args as a sequence"
command = f'{g.sys.executable} {g.app.loadDir}/runLeo.py "{fn}"'
command = [g.sys.executable, f"{g.app.loadDir}/runLeo.py", fn]
I've never used this command before and I just tried it and I get a similar error.https://github.com/leo-editor/leo-editor/commit/016867f5ade5da6796397ab4705287bf8b8f336a - this is the commit which fixed #1425 for Windows by using subprocess.Popen instead of os.system.The documentation for subprocess.Popen looks complicated: https://docs.python.org/3/library/subprocess.html and it looks like the behavior is different for windows and Posix."args should be a sequence of program arguments or else a single string or path-like object. By default, the program to execute is the first item in args if args is a sequence. If args is a string, the interpretation is platform-dependent and described below"andSo maybe passing as a list rather than string will work for both platforms. Instead of this:"Unless otherwise stated, it is recommended to pass args as a sequence"command = f'{g.sys.executable} {g.app.loadDir}/runLeo.py "{fn}"'thiscommand = [g.sys.executable, f"{g.app.loadDir}/runLeo.py", fn]