[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r31953 - branches/ctypes-python-bindings

From: Blair Zajac <blair_at_orcaware.com>
Date: Tue, 01 Jul 2008 12:02:48 -0700

Jeremy Whitlock wrote:
>> Wouldn't it be safer to use os.path.join() instead of string concatenation?
>> This is for non-Unix platforms.
>
> While I agree that os.path.join() is probably the preferred approach,
> using "/" on Windows in Python is handled properly. The following are
> all interpreted the same in Python:
>
> os.path.exists("C:/svn-repos/test")
> os.path.exists("C:\\svn-repos\\test")
> os.path.exists(os.path.join("C:" + os.path.sep, "svn-repos", "test")

With the current code, you end up with

os.path.exists("C:\\svn-repos/test")

which I don't know if that works for not. I'd rather not have to think about it
when reviewing code, so if I use os.path.join(), I don't need to worry about it.

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-01 21:03:04 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.