I don't think this is specific to Python, this is a Windows issue at heart.
On Windows, C: and C:\ (or, alternatively, C:/ ) have completely different meanings:
C: refers to the current directory on drive C:C:\ (and C:/ ) refers to the root directory of drive C:
While UNIX-like operating systems simply have a "current directory", Windows has two different concepts:
- current drive and
- current directory to disk
Thus, the current drive can be D: current directory on C: can be \Windows (effectively C:\Windows ), and the current directory on D: can be \Data (effectively D:\Data )). In this scenario, the resolution will work as follows:
. will refer to D:\Data\ will refer to D:\C: will refer to C:\WindowsC:\Foo will refer to C:\Foo
So, if you want to have information about a specific directory, you should always use the full path, including both the drive and the directory, for example C:\ .
Joachim sauer
source share