Demo:
>>> pathlib.PureWindowsPath("C:\\Windows").as_uri()
'file:///C:/Windows'
>>> RI("file:///c:/Windows").localpath
'/c:/Windows'
>>> pathlib.PureWindowsPath('/c:/Windows')
PureWindowsPath('/c:/Windows')
Ergo, it get's transformed into an unusable string.
A better approach would be:
>>> nturl2path.url2pathname(urlparse("file:///c:/Windows").path)
'C:\\Windows'
nturl2path.url2pathname is called by urllib.request.url2pathname on windows.
Demo:
Ergo, it get's transformed into an unusable string.
A better approach would be:
nturl2path.url2pathnameis called byurllib.request.url2pathnameon windows.