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

Guido van Rossum report at bugs.python.org
Wed Nov 7 17:00:30 CET 2007


Guido van Rossum added the comment:

Works for me!

On Nov 7, 2007 6:08 AM, Christian Heimes <report at bugs.python.org> wrote:
>
> Christian Heimes added the comment:
>
> Brett Cannon wrote:
> > Modules/getpath.c:joinpath() I think does what you want in C.
>
> I don't see how it is going to help us.
>
> I've a final offer before I declare the bug as SEP (someone else's problem):
>
> pseudo code
>
> #ifdef MS_WINDOWS
>     rv = stat(...)
>     if (rv == error)
>         check for *one* trailign / or \ and remove it
>         rv = stat(...)
>         if (rv == error)
>             give up
> #endif
>
> It should fix the case when somebody adds a directory with a trailing /
> or \ on Windows. More complex cases are still broken but that's really
> not my concern. ;)
>
> Christian
>
>
> __________________________________
> Tracker <report at bugs.python.org>
> <http://bugs.python.org/issue1293>
> __________________________________
>

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


More information about the Python-bugs-list mailing list