PR #3277 has been merged into devel

27 views
Skip to first unread message

Edward K. Ream

unread,
Apr 17, 2023, 9:44:49 PM4/17/23
to leo-editor

PR #3277 changes g.os_path_finalize and g.os_path_finalize_join, and rev 32c9f adds a missing alias.


These changes are non-trivial. Please report any problems immediately.


Edward

lewis

unread,
Apr 18, 2023, 7:01:50 AM4/18/23
to leo-editor
Running this script from the Leo scripting tutorial:

fn = g.os_path_finalize_join(g.app.homeDir, 'leo_output_file.txt')
with open(fn, 'w') as f:
    f.write(c.p.b)
with open(fn, 'r') as f:
    for line in f.readlines():
        g.es(line.rstrip())

Gives traceback:
Leo 6.7.3-devel, devel branch, build e2c9fa06e0
2023-04-17 20:36:03 -0500
Python 3.11.3, PyQt version 6.5.0
Windows 10 AMD64 (build 10.0.19044) SP0
exception executing script
Traceback (most recent call last):
  File "N:\git\leo-editor\leo\core\leoCommands.py", line 1194, in executeScript
c.executeScriptHelper(args, define_g, define_name, namespace, script)
  File "N:\git\leo-editor\leo\core\leoCommands.py", line 1239, in executeScriptHelper
exec(compile(script, scriptFile, 'exec'), d)
  File "C:/Users/lewisneal/.leo/scriptFile.py", line 3, in <module>
fn = g.os_path_finalize_join(g.app.homeDir, 'leo_output_file.txt')
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'leo.core.leoGlobals' has no attribute 'os_path_finalize_join'

Thomas Passin

unread,
Apr 18, 2023, 8:16:36 AM4/18/23
to leo-editor
However, the function *did* exist on the previous changeset:

Leo 6.7.3-devel, devel branch, build edf4b48991
2023-04-16 08:20:16 -0500

Python 3.11.3, PyQt version 6.4.3


Windows 10 AMD64 (build 10.0.19044) SP0

Edward K. Ream

unread,
Apr 18, 2023, 10:45:27 AM4/18/23
to leo-e...@googlegroups.com
On Tue, Apr 18, 2023 at 6:01 AM lewis <lewi...@fastmail.com.au> wrote:

AttributeError: module 'leo.core.leoGlobals' has no attribute 'os_path_finalize_join'

Thanks for this report. I'll fix #3285 immediately.

Edward
Reply all
Reply to author
Forward
0 new messages