Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82891 > unrolled thread

Re: is pathlib Path.resolve working as intended?

Started byChris Cioffi <chris@evenprimes.com>
First post2014-12-24 09:09 -0500
Last post2014-12-24 09:09 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: is pathlib Path.resolve working as intended? Chris Cioffi <chris@evenprimes.com> - 2014-12-24 09:09 -0500

#82891 — Re: is pathlib Path.resolve working as intended?

FromChris Cioffi <chris@evenprimes.com>
Date2014-12-24 09:09 -0500
SubjectRe: is pathlib Path.resolve working as intended?
Message-ID<mailman.17184.1419432378.18130.python-list@python.org>
That's what I thought as well.  Then I found https://bugs.python.org/issue19776 and it looks like this is a well known issue.  Hopefully the patches are working and will be accepted in the next release or so.  

Given how often os.path.expanduser() is needed, I'm a little surprised that the pathlib module was even put in provisionally.  I do like how it works, however.  Paths as objects and not strings!  Its a beautiful idea, just not 100% complete.

PS:  For those who are curious, the 2 issues that seemed to hold things up the most are non-Unix systems (Windows) and how to handle when there is no home directory.  Posix only says that the results are undefined.  

> On Dec 24, 2014, at 8:38 AM, Skip Montanaro <skip.montanaro@gmail.com> wrote:
> 
>>>> 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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web