os.path and Path

Ethan Furman ethan at stoneleaf.us
Thu Jun 16 13:07:58 EDT 2011


Christian Heimes wrote:
> Am 16.06.2011 18:16, schrieb Ethan Furman:
>> 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 ':'.
> 
> "c:d" is a valid directory name on Linux. :]

Right.  I didn't phrase that at all well.  In Steven's examples, which 
are the path pieces?  I'm guessing

'a', 'b', 'c:d', 'e'; and
'a', 'b', 'c/d', 'e'.

~Ethan~



More information about the Python-list mailing list