You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due some problem in a third-party package the url2path function from nturl2path got a/"https://b" (without , a,b` are just masks ) as the first and only argument.
comp = url.split('|')
if len(comp) != 2 or comp[0][-1] not in string.ascii_letters:
error = 'Bad URL: ' + url
raise OSError(error)
drive = comp[0][-1].upper()
As a result, the function decided that the file was located on the `S:` drive and returned the `S:\b` path without a warning.
To my mind, it is not right to take just the last letter as a drive letter because the returned path must be only for the specified URL and the unsupported ones must be marked as "bad" without any silent transformations.
Activity
NickVeld commentedon Aug 2, 2021
Due some problem in a third-party package the
url2pathfunction fromnturl2pathgota/"https://b"(without,a,b` are just masks ) as the first and only argument.In the function there is the following code (
cpython/Lib/nturl2path.py
Line 30 in 414dcb1
mainbranch):As a result, the function decided that the file was located on the `S:` drive and returned the `S:\b` path without a warning.
To my mind, it is not right to take just the last letter as a drive letter because the returned path must be only for the specified URL and the unsupported ones must be marked as "bad" without any silent transformations.
NickVeld commentedon Aug 2, 2021
For the visualization I created a PR with a possible fix. (The link is set into the corresponding field.)
If everything is OK, I will perform all the required things like the CLA, news entry...