Bookmarks plugin - crashes loading layout

31 views
Skip to first unread message

lewis

unread,
Mar 15, 2018, 1:25:54 AM3/15/18
to leo-editor
After a recent commit 8ab89ca6f5a1, my bookmarks failed to display.
I right-clicked over a pane divider and selected Load Layout > bookmarks_name

Leo then crashed with a dialog box [python has stopped working]

Traceback (most recent call last):
  File "N:\git\leo-editor\leo\plugins\nested_splitter.py", line 350, in cb
    splitter.context_cb(id_, index)
  File "N:\git\leo-editor\leo\plugins\nested_splitter.py", line 650, in context_cb
    provided = provider.ns_do_context(id_, self, index)
  File "N:\git\leo-editor\leo\plugins\free_layout.py", line 311, in ns_do_context
    self.get_top_splitter().load_layout(layout)
  File "N:\git\leo-editor\leo\plugins\nested_splitter.py", line 1071, in load_layout
    new.load_layout(i, level + 1)
  File "N:\git\leo-editor\leo\plugins\nested_splitter.py", line 1073, in load_layout
    provided = self.get_provided(i)
  File "N:\git\leo-editor\leo\plugins\nested_splitter.py", line 1125, in get_provided
    provided = provider.ns_provide(id_)
  File "N:\git\leo-editor\leo\plugins\bookmarks.py", line 1212, in ns_provide
    ok, depth, other_p = g.recursiveUNLFind(UNL.split('-->'), other_c)
  File "N:\git\leo-editor\leo\core\leoGlobals.py", line 3813, in recursiveUNLFind
    target = unlList[depth]
IndexError: list index out of range
[end]

Leo Log Window
Leo 5.8 devel, build 20180307231313, Wed Mar 7 23:13:13 PST 2018
Git repo info: branch = devel, commit = a7ad18cbb012
Python 3.6.4, PyQt version 5.10.1
Windows 10 AMD64 (build 10.0.16299) SP0
isPython3: True

Regards
Lewis

Edward K. Ream

unread,
Mar 15, 2018, 3:36:15 AM3/15/18
to leo-editor
On Thu, Mar 15, 2018 at 12:25 AM, lewis <lewi...@operamail.com> wrote:
After a recent commit 8ab89ca6f5a1, my bookmarks failed to display.

​Drat.  This rev replaces glob.glob with g.glob_glob. However, there are no direct calls to glob in the bookmarks plugin.
 
I right-clicked over a pane divider and selected Load Layout > bookmarks_name

Leo then crashed with a dialog box [python has stopped working]

​Hmm. Hard crashes aren't supposed to be possible...

  File "N:\git\leo-editor\leo\core\leoGlobals.py", line 3813, in recursiveUNLFind
    target = unlList[depth]
IndexError: list index out of range
[end]

​Rev ed74121 catches this IndexError, and attempts a recovery.  However, the following code is complex, so there is no guarantee that the new code is an improvement.

The problem may be deeper.  I have just created #812:
g.glob_glob may have broken bookmarks/urls/unls on Windows

This looks like an urgent bug.

Edward

Edward K. Ream

unread,
Mar 15, 2018, 4:30:39 AM3/15/18
to leo-editor
On Thursday, March 15, 2018 at 2:36:15 AM UTC-5, Edward K. Ream wrote:

> I have just created #812: g.glob_glob may have broken bookmarks/urls/unls on Windows

I have just closed this item.  Please reopen the item if problems remain.

The bookmarks class uses c.db, which can be a PickleShareDB object.  Improperly munging db keys by calling g.glob_glob was likely the ultimate cause of the bug.

My profuse apologies for this screw up. Are you able to recover your bookmarks?

Edward

lewis

unread,
Mar 15, 2018, 7:29:51 AM3/15/18
to leo-editor
Yes, I was able to reload my saved bookmark layouts. Nothing lost.

Thanks
Lewis

Terry Brown

unread,
Mar 15, 2018, 9:24:32 AM3/15/18
to leo-e...@googlegroups.com
On Thu, 15 Mar 2018 01:30:39 -0700 (PDT)
"Edward K. Ream" <edre...@gmail.com> wrote:

> Are you able to recover your bookmarks?

Selecting the top node of the bookmarks subtree and executing
`bookmarks-show` should suffice (possibly opening a second bookmarks
pane, but that's a one time thing). The c.db entry is only to keep track
of the top node of the bookmarks subtree.

Cheers -Terry

Edward K. Ream

unread,
Mar 15, 2018, 9:44:41 AM3/15/18
to leo-editor
On Thu, Mar 15, 2018 at 6:29 AM, lewis <lewi...@operamail.com> wrote:
Yes, I was able to reload my saved bookmark layouts. Nothing lost.

​Whew! So glad to hear it.

Edward
Reply all
Reply to author
Forward
0 new messages