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


Groups > comp.lang.python > #82891

Re: is pathlib Path.resolve working as intended?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <chris@evenprimes.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'needed,': 0.07; 'paths': 0.07; 'mentions': 0.09; 'seemed': 0.09; 'skip:/ 10': 0.09; 'cc:addr:python-list': 0.11; 'bug': 0.12; '"~"': 0.16; '(windows)': 0.16; '24,': 0.16; 'cc:name:python list': 0.16; 'oddly': 0.16; 'patches': 0.16; 'received:10.5.19': 0.16; 'received:10.5.19.251': 0.16; 'received:filter.hostedemail.com': 0.16; 'received:hostedemail.com': 0.16; 'undefined.': 0.16; 'so.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'addition,': 0.20; 'seems': 0.21; 'issue.': 0.22; 'cc:addr:python.org': 0.22; 'directory.': 0.24; 'either.': 0.24; 'from:addr:chris': 0.24; 'skip': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'mention': 0.26; 'task': 0.26; 'supported': 0.26; 'header:In-Reply-To:1': 0.27; 'url:bugs': 0.29; 'am,': 0.29; "doesn't": 0.30; 'dec': 0.30; 'expansion': 0.30; "i'm": 0.30; "skip:' 10": 0.31; '>>>>': 0.31; 'doc': 0.31; 'idea,': 0.31; 'file': 0.32; 'open': 0.33; 'says': 0.33; 'url:python': 0.33; 'guess': 0.33; "i'd": 0.34; 'common': 0.35; 'objects': 0.35; 'but': 0.35; 'there': 0.35; 'complete.': 0.36; 'next': 0.36; 'method': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'so,': 0.37; 'received:10': 0.37; 'skip:o 20': 0.38; 'handle': 0.38; 'little': 0.38; 'enough': 0.39; 'release': 0.40; 'how': 0.40; 'even': 0.60; 'most': 0.60; 'received:173': 0.61; 'header:Message-Id:1': 0.63; 'such': 0.63; 'to:addr:gmail.com': 0.65; 'beautiful': 0.68; 'home': 0.69; 'results': 0.69; 'saw': 0.77; '100%': 0.77; '2014,': 0.84; 'directory:': 0.84; 'received:216.40': 0.84
X-Session-Marker 6368726973406576656E7072696D65732E636F6D
X-Spam-Summary 30, 2, 0, , d41d8cd98f00b204, chris@evenprimes.com, :::, RULES_HIT:41:355:379:541:564:599:800:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1777:1792:2376:2393:2525:2553:2560:2563:2682:2685:2693:2829:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4401:5007:6261:7514:7903:8700:8957:9025:9036:9040:9707:10004:10400:10848:11232:11658:11914:12043:12517:12519:12555:12663:13069:13311:13357:21080, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0
X-HE-Tag star74_18e306cc9cf56
X-Filterd-Recvd-Size 2323
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Mac OS X Mail 8.1 \(1993\))
Subject Re: is pathlib Path.resolve working as intended?
From Chris Cioffi <chris@evenprimes.com>
In-Reply-To <CANc-5UxE8_h9OnqAj+jSFrknU4G-yTYc0azS+JptYPbKtc9=bw@mail.gmail.com>
Date Wed, 24 Dec 2014 09:09:30 -0500
Content-Transfer-Encoding quoted-printable
References <203896CA-3C8E-4BFA-9657-5A1749EF52CC@evenprimes.com> <CANc-5UxE8_h9OnqAj+jSFrknU4G-yTYc0azS+JptYPbKtc9=bw@mail.gmail.com>
To Skip Montanaro <skip.montanaro@gmail.com>
X-Mailer Apple Mail (2.1993)
Cc python list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17184.1419432378.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1419432378 news.xs4all.nl 2945 [2001:888:2000:d::a6]:52024
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82891

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web