[MERGE] Bugfix #68124: Allow import plugins from zip archives

Jan Hudec bulb at ucw.cz
Tue Jan 2 19:01:08 GMT 2007


On Tue, Jan 02, 2007 at 10:45:16AM -0500, Aaron Bentley wrote:
> > 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.
> > >>> a = 'a\\b\\c'
> > >>> b = 'a/b/c'
> > >>> import os
> > >>> os.path.split(a)
> > ('a\\b', 'c')
> > >>> os.path.split(b)
> > ('a/b', 'c')
> > >>>
> >
> >As you could see this function don't depends on os.sep.
> 
> When we're dealing with '/'-delimited paths, we use the functions in 
> osutils.
> 
> I don't know why os.path.split('a/b/c') works on Windows, but I assume 
> it's Windows-specific compatibility code.

Because '/' *is* valid path separator on windows. In fact all windows
syscalls do accept both '/' and '\' as separator. As far as I know (and
I often run Windows commands from cygwin shell), the only place wehre
'/' is not accepted is in cmd.exe in path to executable and in arguments
to builtin commands. Everywhere else it just works.

> Certainly, it behaves differently on Windows vs Unix:
> >>> a = 'a\\b\\c'
> >>> os.path.split(a)
> ('', 'a\\b\\c')

Sure. Because on unix '\\' is a legal character in filename.

--------------------------------------------------------------------------------
                  				- Jan Hudec `Bulb' <bulb at ucw.cz>




More information about the bazaar mailing list