** in a glob doesn't resolve symlinks when using Path.glob. In cases where it's used, glob.glob(..., recursive=True) should be used instead. For instance:
Tree:
- a/
- - c/
- - - d
- b -> a
Expected: **/d -> [a/c/d, b/c/d]
Actual:
glob.glob('**/d', recursive=True) -> ['a/c/d', 'b/c/d'] # pass (recursive=True enables **)
list(Path('.').glob('**/d')) -> [PosixPath('a/c/d')] # fail (** enabled by default)
Affected dataset(s)
codesearchnet (unlikely since it's auto-manged)
trec-mandarin
trec-robust04
trec-spanish
tripclick (unlikely since it's auto-manged)
Expected behavior
Symlinks should be allowed (and encouraged!)
Additional context
Interestingly, both the PEPs and the documentation don't shine any light on the reasoning for this discrepancy.
Describe the bug As reported by @searchivarius
**
in a glob doesn't resolve symlinks when usingPath.glob
. In cases where it's used,glob.glob(..., recursive=True)
should be used instead. For instance:Affected dataset(s)
codesearchnet
(unlikely since it's auto-manged)trec-mandarin
trec-robust04
trec-spanish
tripclick
(unlikely since it's auto-manged)Expected behavior Symlinks should be allowed (and encouraged!)
Additional context Interestingly, both the PEPs and the documentation don't shine any light on the reasoning for this discrepancy.