As mentiond by Ryan it's doing exactly what the documentation says.
From DOS times, current disk, and current path are distinguished.
\
is the root path, but for the CURRENT DISK.
For every "disk" there is a separate "current path".
If you change the disk using cd D:
you do not change the current path to D:\
, but to: "D:\whatever\was\the\last\path\accessed\on\this\disk"...
So, in windows, a literal @"\x"
means: "CURRENTDISK:\x".
Hence Path.Combine(@"C:\x", @"\y")
has as second parameter a root path, not a relative, though not in a known disk...
And since it is not known which might be the «current disk», python returns "\\y"
.
>cd C:
>cd \mydironC\apath
>cd D:
>cd \mydironD\bpath
>cd C:
>cd
>C:\mydironC\apath