ntpath bug or expected?

Martin v. Loewis martin at v.loewis.de
Thu Sep 12 02:50:49 EDT 2002

"dsavitsk" <dsavitsk at e-coli.net> writes:

> it seems to me, i guess, that being inconsistent here and in
> os.getcwd in a consistent way is confusing.  if getcwd returned C:
> instead of C:\\ (as it returnes C:\\path and not C:\\path\\) then
> os.path.join(os.getcwd(), 'path', 'file.txt') with my modification
> would do the same thing as it now does, but it would have the added
> bonuses of returning a full file path and removing 2 bits of
> necessary documentation from the language.

As Jeff explains, that confusion really comes from the system, in
particular, from the notion of lettered drives, the notion of a
"current drive", and the notion of a per-drive "current directory".

That results in c:foo being a relative path, not an absolute one, and
it is different from c:\foo. Therefore, os.path.join("c:","foo") and
os.path.join("c:",os.sep,"foo") are different things.


More information about the Python-list mailing list