Message331491
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'))) # TypeError
tuple(Path('C:\\').glob(PurePath('Windows'))) # AttributeError
tuple(Path('C:\\').rglob(PurePath('Windows'))) # AttributeError
# works
from os import fspath
tuple(Path('/etc').glob(fspath(PurePath('passwd'))))
tuple(Path('/etc').rglob(fspath(PurePath('passwd'))))
tuple(Path('C:\\').glob(fspath(PurePath('Windows'))))
tuple(Path('C:\\').rglob(fspath(PurePath('Windows')))) |
|
| Date |
User |
Action |
Args |
| 2018-12-10 10:54:42 | ciupicri | set | recipients:
+ ciupicri |
| 2018-12-10 10:54:42 | ciupicri | set | messageid: <[email protected]> |
| 2018-12-10 10:54:42 | ciupicri | link | issue35453 messages |
| 2018-12-10 10:54:41 | ciupicri | create | |
|