Why os.path.isabs("/") on Windows returns True?

Ross Ridge rridge at caffeine.csclub.uwaterloo.ca
Sat Feb 2 01:14:05 CET 2008


Grant Edwards  <grante at visi.com> wrote:
>I guess it depends on your definition of "absolute".  In my
>mind, it means that it always refers to the same location
>regardless of the CWD.

Strictly speaking "/" refers to same location regardless of the current
working directory (CWD) on Windows.  It's only relative with respect
of the current drive, which Windows considers something different than
the current working directory.  On the other hand Python on Window
does for the most part hide this, treating the current drive as being
part of current working directory, so it's strange the isabs() behaves
differently.

						Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge at csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/~rridge/ 
 db  //	  



More information about the Python-list mailing list