[Python-ideas] os.path.join

Ethan Furman ethan at stoneleaf.us
Sun Nov 3 04:40:36 CET 2013


On 11/02/2013 08:12 PM, Ryan Hiebert wrote:
> IIRC correctly the form 'd:efg' refers to a relative path on the d:
> drive, based on the current working directory _of that drive_. Since
> it requires a default base path to be relative on, that form wouldn't
> work cross drives. However if we used the same drive, we might be
> willing to allow a relative path prefixed with a  drive letter.
>
> os.path.join(r'c:\abc\foo', 'd:efg') # ERROR
> os.path.join(r'd:\abc\foo', 'd:efg') # returns r'd:\abc\efg'

Surely you meant r'd:\abc\foo\efg'.

--
~Ethan~


More information about the Python-ideas mailing list