Strange "feature" involving double slashes in Win98

Jeff Shannon jeff at ccvcorp.com
Tue Sep 14 16:34:04 EDT 2004


Carlos Ribeiro wrote:

>** Solving the problem **
>
>DrPython relies on string concatenation to build new pathnames. My
>root dir is "c:/", and at some places in the code, other pieces are
>concatenated to it, causing the problem. 
>

It seems to me that the problem, here, is that DrPython *should* be 
using os.path.join() to build those pathnames, instead of 
concatenation.  (os.path.join() intelligently removes duplicate 
directory separators.)  That may not help you much, though, since that's 
not your code.  (If you're not already reporting this as a [series of] 
bug[s] in DrPython, you probably should...)

Given that fixing DrPython isn't a very practical option for you, I'd 
say that wrapping the os module may be the best option left, but I'm not 
sure how one would go about that.  Given that os is a built-in module, 
you'd probably have to pull some trickery with sys.modules once the 
interpreter was started, and I don't understand that whole process well 
enough to be able to offer specific advice.

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list