This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2021年08月05日 16:15 by manish.satwani, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg399008 - (view) | Author: Manish Satwani (manish.satwani) | Date: 2021年08月05日 16:15 | |
import pathlib
p = pathlib.Path('adl://myblob.azuredatalakestore.net/local/abc/xyz')
s = str(p)
print(s)
what you expect s to be??
There is a bug in path.Path.str(conversion to string) and it remove a slash
s is 'adl:/myblob.azuredatalakestore.net/local/abc/xyz' <-- this is getting print....plz fix it
|
|||
| msg399009 - (view) | Author: Manish Satwani (manish.satwani) | Date: 2021年08月05日 16:16 | |
import pathlib
p = pathlib.Path('adl://myblob.azuredatalakestore.net/local/abc/xyz')
s = str(p)
print(s)
what you expect s to be??
There is a bug in path.Path.str(conversion to string) and it remove a slash
s is 'adl:/myblob.azuredatalakestore.net/local/abc/xyz' <-- this is getting print....plz fix it
|
|||
| msg399013 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2021年08月05日 16:30 | |
pathlib is not designed to support URIs, so this behavior is not surprising. You want to use a different library, maybe urllib. |
|||
| msg399036 - (view) | Author: Manish Satwani (manish.satwani) | Date: 2021年08月05日 20:15 | |
Thanks for the update Eric, if it is not designed to support URI it should tell to the user. It is very wired it just returns wrong data. You can detect it very well if user has specified URI or not. |
|||
| msg399043 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2021年08月05日 22:10 | |
But that's a perfectly valid filename: $ mkdir -p adl://myblob.azuredatalakestore.net/local/abc/xyz $ ls -R adl: 'adl:': myblob.azuredatalakestore.net/ 'adl:/myblob.azuredatalakestore.net': local/ 'adl:/myblob.azuredatalakestore.net/local': abc/ 'adl:/myblob.azuredatalakestore.net/local/abc': xyz/ 'adl:/myblob.azuredatalakestore.net/local/abc/xyz': The pathlib module isn't going to guess whether you passed it a filename or URI of some sort, especially when it's a valid filename. That's the caller's job to get right. Removing the double slashes is a normal part of pathlib's behavior of normalizing paths, just as if you said from a bash shell "ls //etc//sysconfig", which will show the contents of "/etc/sysconfig". Although I'll admit I couldn't find this documented anywhere with a quick search. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:48 | admin | set | github: 89005 |
| 2021年08月05日 22:10:06 | eric.smith | set | status: open -> closed resolution: not a bug messages: + msg399043 stage: resolved |
| 2021年08月05日 20:15:07 | manish.satwani | set | messages: + msg399036 |
| 2021年08月05日 16:30:00 | eric.smith | set | nosy:
+ eric.smith messages: + msg399013 |
| 2021年08月05日 16:16:06 | manish.satwani | set | messages: + msg399009 |
| 2021年08月05日 16:15:08 | manish.satwani | create | |