Re: Relative versus absolute paths on Windows

2009-11-23 Thread Nobody
On Tue, 24 Nov 2009 02:23:19 +0100, Christian Heimes wrote: > Gregory Ewing wrote: >> ntpath.join('d:\\foo', '\\bar') >>> '\\bar' >> >> This does seem like a bug, though -- the correct result >> should really be 'd:\\bar', since that's what you would >> get if you used the name '\\bar' with '

Re: Relative versus absolute paths on Windows

2009-11-23 Thread Ethan Furman
Christian Heimes wrote: Gregory Ewing wrote: ntpath.join('d:\\foo', '\\bar') '\\bar' This does seem like a bug, though -- the correct result should really be 'd:\\bar', since that's what you would get if you used the name '\\bar' with 'd:' as your current drive. No, it's not a bug. Since

Re: Relative versus absolute paths on Windows

2009-11-23 Thread Christian Heimes
Gregory Ewing wrote: > ntpath.join('d:\\foo', '\\bar') >> '\\bar' > > This does seem like a bug, though -- the correct result > should really be 'd:\\bar', since that's what you would > get if you used the name '\\bar' with 'd:' as your current > drive. No, it's not a bug. Since \bar is an ab

Re: Relative versus absolute paths on Windows

2009-11-23 Thread Ethan Furman
Jason R. Coombs wrote: On Nov 20, 3:52 pm, Ethan Furman wrote: It is often said on this list that 'Python is not Java'. It is also true that 'Windows is not Unix'. Unlike the *nix world where there is a *single* root, and everything else is relative to that, in the Windows world there are se

Re: Relative versus absolute paths on Windows

2009-11-23 Thread Jason R. Coombs
On Nov 20, 3:52 pm, Ethan Furman wrote: > It is often said on this list that 'Python is not Java'.  It is also > true that 'Windows is not Unix'. > > Unlike the *nix world where there is a *single* root, and everything > else is relative to that, in the Windows world there are several roots > -- e

Re: Relative versus absolute paths on Windows

2009-11-20 Thread Gregory Ewing
Jason R. Coombs wrote: In other words, paths without a drive letter are reported as absolute, but treated as relative, except in a few special cases. It's not clear what the result ought to be here, since Windows drive-relative paths don't really fit into the unix absolute/relative dichotomy.

Re: Relative versus absolute paths on Windows

2009-11-20 Thread Ethan Furman
Jason R. Coombs wrote: The current implementation of Python (2.6.4, 3.1.1) treats \bar as a relative path but reports it as an absolute path. ntpath.isabs('\\bar') True ntpath.abspath('\\bar') 'C:\\bar' os.chdir('d:\\') ntpath.abspath('\\bar') 'd:\\bar' os.chdir('server\\share'

Relative versus absolute paths on Windows

2009-11-20 Thread Jason R. Coombs
The current implementation of Python (2.6.4, 3.1.1) treats \bar as a relative path but reports it as an absolute path. >>> ntpath.isabs('\\bar') True >>> ntpath.abspath('\\bar') 'C:\\bar' >>> os.chdir('d:\\') >>> ntpath.abspath('\\bar') 'd:\\bar' >>> os.chdir('server\\share') >>> ntpath.abspat