[Python-Dev] path joining on Windows and imp.cache_from_source()

Brett Cannon brett at python.org
Sun Apr 22 08:09:31 CEST 2012


On Sun, Apr 22, 2012 at 01:45, "Martin v. Löwis" <martin at v.loewis.de> wrote:

> > Now that we can reuse os.path.join() (directly for source_from_cache(),
> > indirectly through easy algorithmic copying in cache_from_source()) do
> > we want to keep the "special" semantics, or can I change it to match
> > what ntpath would do when there can be more than one path separator on
> > an OS (i.e. not do anything special)?
>
> This goes back to
>
> http://codereview.appspot.com/842043/diff/1/3#newcode787
>
> where Antoine points out that the code needs to look for altsep.
>
> He then suggests "keep the right-most of both". I don't think he
> literally meant that the right-most separator should then also be
> used to separate __pycache__, but only that the right-most of
> either SEP or ALTSEP is what separates the module name.
>
> In any case, Barry apparently took this comment to mean that the
> rightmost separator should be preserved.
>
> So I don't think this is an important feature.
>

OK, then I'll go back to ntpath.join()/split() semantics of caring on split
about altsep but not on join to keep it consistent w/ os.path and what
people are used to.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120422/16343d78/attachment.html>


More information about the Python-Dev mailing list