You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have trouble getting Folder.glob to work for deeper nested glob patterns. The issue seems to stem from using rsplit inside
the _glob function of Folder:
If we for example have the pattern root/inbox/todos, then glob won't return any folder entry even if the path exists. You use rsplit('/', 1) which will split on the first / it encounters from the right but then stop, e.g.
"root/inbox/todos".rsplit('/', 1) # will return ["root/inbox", "todos"]
Afterwards you match each child of the folder with the first part of the returned array, e.g.
fnmatch('root', 'root/inbox') # will return false
I think you meant to use split not rsplit. split splits starting from the left and would correctly only use root as the argument to fnmatch.
Did I miss something here? If my assumptions are correct I am happy to submit a small pull request to remedy this issue.
The text was updated successfully, but these errors were encountered:
Hello,
I have trouble getting
Folder.glob
to work for deeper nested glob patterns. The issue seems to stem from usingrsplit
insidethe
_glob
function ofFolder
:exchangelib/exchangelib/folders.py
Line 428 in a9369b2
If we for example have the pattern
root/inbox/todos
, thenglob
won't return any folder entry even if the path exists. You usersplit('/', 1)
which will split on the first/
it encounters from the right but then stop, e.g.Afterwards you match each child of the folder with the first part of the returned array, e.g.
I think you meant to use
split
notrsplit
.split
splits starting from the left and would correctly only useroot
as the argument tofnmatch
.Did I miss something here? If my assumptions are correct I am happy to submit a small pull request to remedy this issue.
The text was updated successfully, but these errors were encountered: