[Tutor] lstrip removes '/' unexpectedly
tim at johnsons-web.com
Mon Dec 3 19:29:17 CET 2007
Trying this again. This list has not be receiving all
of my emails......
On Friday 30 November 2007, Eric Brunson wrote:
> Tim Johnson wrote:
> > Hello:
> > I'm seeing some strange behavior with lstrip operating
> > on string representations of *nix-style file paths
> > Example:
> >>>> s = '/home/test/'
> >>>> s1 = s.lstrip('/home')
> >>>> s1
> > 'test/' ## '/test/' was expected! '/' was unexpectedly removed
I actually resent this as a test because I've had problems contacting
this list. The understanding of it percolated up to my wee little brain
shortly after the first send (which didn't arrive).
I wrote the following as a solution:
else: return S
and a global rstrip would be an easy corrolary.
More information about the Tutor