"Feature" in ntpath.py in Python 2.0?

Ben Allfree cm at bldigital.com
Sun May 6 10:21:49 EDT 2001


Thanks, Tim. I running NT, but when I use the os module to concatenate URLs,
os uses a \ instead of a /. That's why I temporarily changed os.sep to /, but
it doesn't work any more :)

Tim Howarth wrote:

> In message <3AF3A1F2.1CD58F7F at bldigital.com>
>           Ben Allfree <cm at bldigital.com> wrote:
>
> > Does anybody know if join() in ntpath.py was changed from appending the
> > os.sep value to appending a hard-coded "\\"? Unless I changed my distro
> > in previous releases and forgot, I thought os.sep could be changed so
> > that join() would behave differently.
>
> Yes it changed, I was doing work on a non-NT OS which had to play with
> NT filenames in a file.
>
> Trying to use os.path was obviously incorrect so I changed os.sep, that
> failed - ah, I imported ntpath and used that directly.
>
> It actually seemed the correct way to do it.
>
> My guess is..
>
> NTpath if for manipulating NT paths - which should always therefore obey
> NT's conventions, os.path is for manipulating live path names on
> whatever OS it is running.
>
> --
> ___
>  |im    ---- ARM Powered ----




More information about the Python-list mailing list