[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-10 Thread Cristian Ciupitu
Cristian Ciupitu added the comment: Err, I meant os.path.join instead of os.path.combine. -- ___ Python tracker <https://bugs.python.org/issue35453> ___ ___

[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-10 Thread Cristian Ciupitu
Cristian Ciupitu added the comment: What if the pattern has some directories in it, e.g. "SourceArt/**/*.png", how do you compose it? The traditional way is to either hardcode the separator (e.g. / or \) or use os.path.combine. I don't see why PurePath can't be used for this, e.g

[issue35453] pathlib.Path: glob and rglob should accept PathLike patterns

2018-12-10 Thread Cristian Ciupitu
New submission from Cristian Ciupitu : pathlib.Path.glob and pathlib.Path.rglob don't work with os.PathLike patterns. Short example: from pathlib import Path, PurePath # fails tuple(Path('/etc').glob(PurePath('passwd')))# TypeError tuple(Path('/etc').rglob(PurePath('passwd