Suggestion for os.path.join

David Morgenthaler boogiemorg at aol.com
Fri May 25 02:09:21 EDT 2001


> 
> There's your problem right there:
> 
> > >>> PATH = 'D:/SARCrates/SARBoxResults'
> 
> Why put '/'s in a Windows path in the first place?
> 
> ---

Pardon, I could have been a little clearer in my original post. The problem
is not the mixture of '/' and '\'. Rather, the problem is  that os.path.join()
inserts only '\' on Windows, and any occurance of '\' in a path causes some
c-extensions to not work. And os.path.normpath(), etc., only map to '\' on 
Windows.

Interestingly, os has variables os.sep and os.altsep, but these are ignored in
ntpath.join()!

David.



More information about the Python-list mailing list