[Python-ideas] os.path.join
Bruce Leban
bruce at leapyear.org
Wed Oct 30 23:51:01 CET 2013
On Wed, Oct 30, 2013 at 3:10 PM, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote:
> On the other hand, this is also documented and it's wrong by the above
>> standard
>>
>> >>> os.path.join(r'c:\abc', r'\def\g') # Windows paths
>> '\\def\\g'
>>
>
> Actually, it's not -- it gives the same result as the
> equivalent series of Windows CLI commands. Whether that's
> a *useful* result is another matter. :-(
>
I meant cd /D -- which does a true change working directory rather than
bare cd which just changes the directory for the drive but doesn't change
the working drive. Windows maintains separate working directories for each
drive, which frequently surprises users.
Perhaps an os.path.joinw or join_windows_paths would be a good idea.
--- Bruce
I'm hiring: http://www.cadencemd.com/info/jobs
Latest blog post: Alice's Puzzle Page http://www.vroospeak.com
Learn how hackers think: http://j.mp/gruyere-security
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131030/eeeefef3/attachment-0001.html>
More information about the Python-ideas
mailing list