def JoinPath(stem='', *parts):
 parts = [SmartUnicode(path) for path in parts]
 result = (stem + NormalizePath(u'/'.join(parts))).replace('//', '/')
 result = result.rstrip('/')
 return (result or '/')

def JoinPath ( stem = '' , * parts ) : parts = [ SmartUnicode ( path ) for path in parts ] result = ( stem + NormalizePath ( u'/' . join ( parts ) ) ) . replace ( '//' , '/' ) result = result . rstrip ( '/' ) return ( result or '/' )
a sane version of os .