Uh oh!
There was an error while loading. Please reload this page.
All standard library functions accepting str paths must accept PathLike as well #102425
Closed as not planned
There was an error while loading. Please reload this page.
str paths must accept PathLike as well #102425
Inspired by gh-3484 that tried to fix this for
wave.open()only but failed.We need a centralized and universal approach instead so everything accepting
strpaths could automatically acceptPathLikefor free.For this, we can amend stdlib functions to wrap their path arguments into
pathlib.PurePathintroduced in Python 3.4. Unlikeos.fspath, it throws a nicely formatted exception for us:os.fspathfrom the mentioned bpo-31412: wave.open takes a path-like object #3484:cpython/Lib/aifc.py
Lines 912 to 918 in 4a82d65
PurePath: