--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/fd49a5e7-6694-4bf6-9b22-88c517ef38ef%40googlegroups.com.
This bug may be in my code or in Leo-Editor code. I have been seeing occurrences for at least two weeks.
The bug occurs when I run my unit tests for my program that compares two Leo-Editor files. I have 41 unit tests. The bug occurs about once every 30 tests.
I don't know how you go through the nodes of these two files.
If your .leo files contain external files, I would also trace fast_at.scan_lines in leoAtFile.py.
Have you in fact ever seen a phantom vnode? I have not.SegundoBob
Sounds like a worthy bug. Thanks for sharing it with us.
On Friday, September 20, 2019 at 5:33:31 AM UTC-5, Edward K. Ream wrote:Sounds like a worthy bug. Thanks for sharing it with us.A few more thoughts.
# add an import statement
import leo.core.leoCache as leoCache
# and then after closing first commander
cmdr1.close()
# insert the following two lines
bridge.g.app.global_cacher = leoCache.GlobalCacher()bridge.g.app.db = bridge.g.app.global_cacher.db
# now you can open another file
cmdr2 = bridge.openLeoFile(...)#2019-09-22 15:56:08 /pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline
$ ./test02.py
ic| test02.py:62 in main()
cmdrT: Commander 139729630728768: '/pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline/test.leo'
ic| test02.py:62 in main()
cmdrT: Commander 139729631145264: '/pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline/test.leo'
Traceback (most recent call last):
File "./test02.py", line 172, in <module>
main()
File "./test02.py", line 63, in main
cmdrT.save()
File "/pri/git/leo-editor/leo/commands/commanderFileCommands.py", line 355, in save
c.fileCommands.save(c.mFileName)
File "/pri/git/leo-editor/leo/core/leoFileCommands.py", line 1049, in save
g.app.commander_cacher.save(c, fileName, changeName=True)
File "/pri/git/leo-editor/leo/core/leoCache.py", line 99, in save
self.commit()
File "/pri/git/leo-editor/leo/core/leoCache.py", line 58, in commit
self.db.conn.commit()
sqlite3.ProgrammingError: Cannot operate on a closed database.
bridge.g.app.commander_cacher = leoCache.CommanderCacher()bridge.g.app.commander_db = bridge.g.app.commander_cacher.db
2019-09-23 14:55:24 /pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline
$ ./test03.py
Leo 6.1-devel, devel branch, build 53cf6d1bb1
2019-09-23 10:35:13 -0500
Expected:
0 Headline
0.0 Headline
0.0.0 Headline
0.1 Headline
0.2 Headline
0.2.0 Headline
Actual:
NewHeadline
> /pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline/check_file.py(117)checkOutline()
-> exit(50)
(Pdb) where
/pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline/check_file.py(121)<module>()
-> main()
/pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline/check_file.py(56)main()
-> checkOutline(cmdrT, outline)
> /pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline/check_file.py(117)checkOutline()
-> exit(50)
(Pdb) l
112 print(hdr)
113 print('Actual:')
114 for hdr in walkList:
115 print(hdr)
116 import pdb; pdb.set_trace()
117 -> exit(50)
118 #@-others
119
120 if __name__ == "__main__":
121 main()
122 #@-leo
(Pdb) walkList
['NewHeadline']
(Pdb) root
<pos 140033515115520 childIndex: 0 lvl: 0 key: 140033515118376:0 NewHeadline>
(Pdb) root.v
<VNode bob.20190923145528.2 NewHeadline>
(Pdb) root.v.parents
[<VNode hidden-root-vnode-gnx <hidden root vnode>>, <VNode hidden-root-vnode-gnx <hidden root vnode>>]
(Pdb) root.v.children
[]
(Pdb) root.v.parents[0]
<VNode hidden-root-vnode-gnx <hidden root vnode>>
(Pdb) root.v.parents[0].children
[<VNode bob.20190923145528.2 NewHeadline>]
(Pdb) cmdrT
Commander 140033515115464: '/pri/git/leo_bug_demos/2019-09-21-Phantom-NewHeadline/test.leo'
(Pdb)
You can find the three Python files composing test03 here test03
I think the bug is in Leo-Editor
# leoPfn = pathlib.Path('test.leo')
# to
leoPfn = pathlib.Path('test.db')