This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jongfoster
Recipients
Date 2007-03-08.20:53:05
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hi Mark,

Thanks for reviewing this.

You wrote:
> os.path.join("c:\\foo", "\\a")
...
> 'c:\\a' seems the correct result

Yes indeed, and this patch makes it do that.  Hiding in the patch is this changed test case:

-tester("ntpath.join('c:/a', '/b')", '/b')
+tester("ntpath.join('c:/a', '/b')", 'c:/b') # CHANGED: Was '/b')

and these new ones:

+tester('ntpath.join("c:\\a", "\\b")', "c:\\b")
+tester('ntpath.join("c:/a", "/b")', "c:/b")

(Hmm looks like one of those tests is a duplicate... not a big deal I guess).

I guess another way to handle these changes is to introduce new isabsolute(), isrelative(), and joinpath() functions, and deprecate isabs() and join().  (By "deprecate" I mean at least put a warning in the docs that it shouldn't be used; whether or not to make the code raise a DeprecationWarning is a separate decision).  But that's kinda ugly from an API design point of view.  I'm happy to roll a patch that does that, if we decide that fixing isabs() isn't possible.

It's a pity there isn't a way to do something like "from __future__ import fixed_win_paths".  But given how dynamic Python is, I guess that would be hard.

Kind regards,

Jon
History
Date User Action Args
2007-08-23 15:56:47adminlinkissue1669539 messages
2007-08-23 15:56:47admincreate