[Bf-python] Blender.sys.basename() different from os.path.basename() on Windows

Martin Poirier theeth at yahoo.com
Fri Mar 9 02:01:14 CET 2007


On win32, os.altsep is defined as "/" and os.sep as
"\\", that means both separator are accepted (and as
such, Blender.sys.basename is not working right).

Martin

--- Campbell Barton <cbarton at metavr.com> wrote:

> Blender's path functions are path dependant.
> \ - win32, / other os's
> 
> interesting that the OS module works differently...
> It wouldnt be that 
> hard to change blenders to work like os's
> 
> jmsoler at free.fr wrote:
> > Selon Levi Schooley
> <bpycadmin at hhofministries.org>:
> > 
> >> Hello,
> >>
> >> I know this is a bit picky, but I just noticed
> that the following script
> >> prints
> >> two different results.
> >>
> >> # On Windows only
> >> import Blender, os
> >> print os.path.basename("foo/foo.py") # prints
> "foo.py"
> >> print Blender.sys.basename("foo/foo.py") # prints
> "foo/foo.py" ???
> >>
> > 
> > Try the bug tracker :
> >
>
http://projects.blender.org/tracker/?atid=125&group_id=9&func=browse
> > 
> > 
> >> Is this expected behaviour? It's not a big
> problem since Blender comes
> >> bundled
> >> with the os module, but it would be a little more
> convenient if Blender.sys
> >> worked "as expected." Blender.sys.dirname() has
> the same issue.
> >>
> > 
> > In the next Blender, the os module will be no more
> bundled .
> > on
>
http://projects.blender.org/pipermail/bf-python/2007-March/thread.html#4609
> > read the thread :
> > "A python25.zip file is needed for the current
> CVS"
> > 
> > jms
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at projects.blender.org
> >
>
http://projects.blender.org/mailman/listinfo/bf-python
> > 
> 
> 
> -- 
> See MetaVR Visuals Used at the Combat Studies
> Institute
> http://www.metavr.com/casestudies/baghdadviews.html
> 
> Campbell J Barton
> 
> 133 Hope Street
> Geelong West, Victoria 3218 Australia
> 
> URL:    http://www.metavr.com
> e-mail: cbarton at metavr.com
> phone: AU (03) 5229 0241
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
>
http://projects.blender.org/mailman/listinfo/bf-python
> 



 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367



More information about the Bf-python mailing list