Resolver.glob returns IndexError where Resolver.get does not
See original GitHub issueExample:
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, '..')
Node('/top')
Using glob:
>>> r.glob(sub0, '..')
.../anytree/resolver.py 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:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top 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 2_extract_files.py file. Traceback (most recent call last): File "2_extract_files.py", 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Will release 3.0.0 soon
It hasn’t been released yet. The 1.8.1 above was a typo.