is pathlib Path.resolve working as intended?

Skip Montanaro skip.montanaro at gmail.com
Wed Dec 24 08:38:37 EST 2014


>>> p.resolve()
...
FileNotFoundError: [Errno 2] No such file or directory: '/Users/chris/~'

I've not used the pathlib module yet, but poked through the
documentation. Oddly enough, I saw no mention of "~". The doc for the
resolve method only mentions resolving symlinks. In addition, the
pathlib doc doesn't mention "expand" either.

My guess is your working directory was /Users/chris, and that "~"
expansion isn't supported by pathlib. Even so, it seems like a common
enough task that I'd open a bug report/feature request at
bugs.python.org.

Skip



More information about the Python-list mailing list