Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resolver.glob returns IndexError where Resolver.get does not

See original GitHub issue


from anytree import Node
top = Node("top", parent=None)
sub0 = Node("sub0", parent=top)
sub0sub0 = Node("sub0sub0", parent=sub0)
sub0sub1 = Node("sub0sub1", parent=sub0)
sub1 = Node("sub1", parent=top)

from anytree import Resolver
r = Resolver('name')

Getting the top node from sub0:

>>> r.get(sub0, '..')

Using glob:

>>> r.glob(sub0, '..')
.../anytree/ in __glob(self, node, parts)
    165     def __glob(self, node, parts):
    166         nodes = []
--> 167         name = parts[0]
    168         remainder = parts[1:]
    169         # handle relative

IndexError: list index out of range

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

c0fec0decommented, Jul 1, 2021

Will release 3.0.0 soon

zegervdvcommented, Jun 18, 2021

It hasn’t been released yet. The 1.8.1 above was a typo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Glob resolver doesn't support `/` and `~` · Issue #8704 - GitHub
bug report These don't work correctly (the glob resolver doesn't replace these special start characters with the correct absolute path before resolving the ......
Read more >
how do I resolve IndexError: list index out of range?
I get the following error when I run the file. Traceback (most recent call last): File "", line 99, in < ...
Read more >
Python IndexError: List Index Out of Range [Easy Fix] - Finxter
To solve the “IndexError: list index out of range”, avoid do not access a non-existing ... A common cause of the error is...
Read more >
List Index Out of Range – Python Error Message Solved
You'll get the Indexerror: list index out of range error when iterating through a list and trying to access an item that doesn't...
Read more >
How to Fix IndexError in Python - Rollbar
The IndexError in Python occurs when an item from a list is attempted to be accessed that is outside the index range of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found