bpo-44412: add os.path.fileuri()
function. by barneygale · Pull Request #26708 · python/cpython (original) (raw)
One of only three pieces of functionality that's available in the
object-oriented pathlib library, but not the traditional os/os.path
modules.
By moving this functionality to low-level modules, we make progress towards
being able to remove pathlib._Flavour
in bpo-44136 and ultimately unlock
pathlib's OOPy potential in bpo-24132.
This commit also adjusts urllib.request.pathname2url()
to use the new
implementation on Windows. On other platforms, the existing implementation
is retained due to its simplicity and its highly questionable support for
relative file URIs (like 'file:photos/foo.txt'
)