Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'paths': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'linux': 0.11; '>>>': 0.12; 'wrote:': 0.14; "'/'": 0.16; '(does': 0.16; 'furman': 0.16; 'independent,': 0.16; 'likewise': 0.16; 'paths?': 0.16; 'posix': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'cc:addr:python-list': 0.17; 'converted': 0.19; 'header:In-Reply-To:1': 0.21; 'thu,': 0.22; "wasn't": 0.22; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'objects': 0.23; 'systems.': 0.23; "what's": 0.23; 'cc:addr:python.org': 0.30; 'anyone': 0.32; "can't": 0.32; 'steven': 0.32; 'comment': 0.33; "isn't": 0.33; 'file': 0.34; 'to?': 0.34; 'there': 0.35; 'header:User-Agent:1': 0.35; '-0700,': 0.35; "d'aprano": 0.35; 'actual': 0.36; 'platform': 0.36; 'two': 0.37; 'could': 0.38; 'but': 0.38; 'component': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'perhaps': 0.39; 'windows.': 0.39; 'under': 0.40; 'more': 0.60; 'your': 0.60; 'received:websitewelcome.com': 0.67; 'minutes': 0.67; 'legal': 0.70; 'realizing': 0.84; 'received:gateway02.websitewelcome.com': 0.95 Date: Thu, 16 Jun 2011 10:18:44 -0700 From: Ethan Furman User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Steven D'Aprano Subject: Re: os.path and Path References: <4DF9AADE.6090609@gmail.com> <4df9b7be$0$29973$c3e8da3$5496439d@news.astraweb.com> <4dfa324e$0$30002$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <4dfa324e$0$30002$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: mail.admailinc.com ([192.168.10.136]) [72.11.125.166]:1281 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308243853 news.xs4all.nl 49182 [::ffff:82.94.164.166]:37989 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7754 Steven D'Aprano wrote: > On Thu, 16 Jun 2011 09:16:22 -0700, Ethan Furman wrote: > >> Steven D'Aprano wrote: >>> If Path is intended to be platform independent, then these two paths >>> could represent the same location: >>> >>> 'a/b/c:d/e' # on Linux or OS X >>> 'a:b:c/d:e' # on classic Mac pre OS X >>> >>> and be impossible on Windows. So what's the canonical path it should be >>> converted to? >> Are these actual valid paths? I thought Linux used '/' and Mac used >> ':'. > > Er, perhaps I wasn't as clear as I intended... sorry about that. > > On a Linux or OS X box, you could have a file e inside a directory c:d > inside b inside a. It can't be treated as platform independent, because > c:d is not a legal path component under classic Mac or Windows. > > On a classic Mac (does anyone still use them?), you could have a file e > inside a directory c/d inside b inside a. Likewise c/d isn't legal under > POSIX or Windows. > > So there are paths that are legal under one file system, but not others, > and hence there is no single normalization that can represent all legal > paths under arbitrary file systems. Yeah, I was just realizing that about two minutes before I read this reply. Drat. This also makes your comment about sensible path objects more sensible. ;) ~Ethan~