[issue1293] Trailing slash in sys.path cause import failure

Guido van Rossum report at bugs.python.org
Tue Nov 6 20:10:04 CET 2007


Guido van Rossum added the comment:

I see several problems with this, but there's light at the end of the
tunnel.

(1) Don't use s#; it will allow null bytes in the string, which we don't
want.

(2) Put the entire trailing slash removal inside #ifdef MS_WINDOWS.

(3) Careful!  It seems the code you wrote would transform "C:/" into
"C:" which isn't the same thing (the latter refers to the current
directory on the C drive, while the former is the root of the C drive).

----------
nosy: +gvanrossum

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1293>
__________________________________


More information about the Python-bugs-list mailing list