Good catch...  Another solution might be for us to implement ntmath as a 
built-in module that delegates to the BCL's path functionality which should get 
it right on a per-platform basis (or have cli recognized as it's own platform 
and have a clipath.py that does the right thing).

I'll add this to our bug list but I don't know that we'll be able to get this 
one fixed for the next release.  Your work around seems like a decent enough 
one for now.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Wednesday, December 28, 2005 10:06 PM
To: [email protected]
Subject: [IronPython] os.path functions give wrong result on non-Windows 
platforms

Currently, os.path module is same as ntpath, and gives wrong result on
non-Windows platforms.

IronPython 0.9.6 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> import os
>>> os.path.join('a', 'b')
'a\\b'

Currently, I have the following code in my site.py, but obviously this
is not the correct solution:

import System
import os
if str(System.Environment.OSVersion.Platform) == 'Unix':
    import posixpath
    os.path = posixpath

Any idea?

Seo Sanghyeon
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to