On 7/10/07, Philip Jenvey <[EMAIL PROTECTED]> wrote:
>
>
> On Jul 10, 2007, at 11:17 AM, voltron wrote:
>
> >
> > According to the docs, os.path.join does throw the drive letters away:
> >
> > http://docs.python.org/lib/module-os.path.html
> >
> > I still think that it would be cool if there was a platform
> > independent way in Pylons for doing this. Another thing, it would also
> > be nice if one could use several static paths instead of one, just
> > like the templates dict.
> >
> > Could the Pylons developers  comment on this?
> >
>
> I'm not sure I understand all the details. It sounds like the
> os.path.join of root_path and 'public' (or you renamed to to
> 'static') causes an issue on your environment because os.path.join
> removes drive letters and your app is deployed on the D: drive?
>
> os.path.join doesn't appear to mess with drive letters for me:
>
> Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import os
>  >>> os.getcwd()
> 'C:\\Python24'
>  >>> os.path.join(os.getcwd(), 'static')
> 'C:\\Python24\\static'
>  >>>

The docs are talking about a drive letter in the second argument.  In
that case, the drive in the first argument would be discarded, as it
should be, because os.path.join allows absolute paths on the right to
override paths on the left.

The tricky thing with windows is that "C:\\foo" is absolute but
"C:foo" is drive-relative, so join would have to do some extra magic
to ensure the latter case is correct.  But it sounds like the
developers understand the difference.

However, Voltron can replace the entire os.path.join expression with a
different absolute path taken from the config file.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to