[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [rhel6-branch 1/2] iscsi: partial offload drivers.



On Tue, Nov 30, 2010 at 04:33:20PM +0100, Martin Gracik wrote:
> On Tue, 2010-11-30 at 10:23 -0500, Chris Lumens wrote:
> > > > +        full = "%s/%s" % (d, prog)
> > > 
> > > I'd use os.path.join() to make sure there aren't any ugly // in the path
> > 
> > Gotta be careful with os.path.join, though:
> > 
> > commit 9fb8b3c594fda5b6fcebbae18cbbf7aae4255fd7
> > Author: Chris Lumens <clumens redhat com>
> > Date:   Thu Mar 27 15:52:32 2008 -0400
> > 
> >     os.path.join does not work the way we think it should.
> >     
> >     "If any component is an absolute path, all previous components are thrown
> >     away, and joining continues."
> >     
> >     -- http://docs.python.org/lib/module-os.path.html
> 
> that's exactly why I stopped using it too, got almost my whole
> workstation wiped out, when I was testing the removing of files in lorax
> installtree...

Ouch!

I don't think I'll be using os.path.join much in the future.

Thanks!

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)

Attachment: pgpoKMyaJn52Y.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]