setting path separator

Ben Hutchings do-not-spam-ben.hutchings at businesswebsoftware.com
Thu Mar 20 06:52:03 EST 2003


In article <mailman.1048015169.21315.python-list at python.org>,
John Hunter wrote:
> 
> 
> I am trying to compile pygtk in the msys terminal that comes with
> mingw.  But all the calls in setup.py and friends generate paths with
> '\\' as the separator, not '/'.  This screws mingw up.  I naively
> tried setting os.sep='/' at the top of setup.py but this failed.  
> 
> Is it possible to force python to use a given separator for calls to
> os.path.join?

Sure:

    os.path = __import__('posixpath')

I think it may be a mistake to use MSYS for this, though.




More information about the Python-list mailing list