os.path.escape?

Mike C. Fletcher mcfletch at home.com
Fri May 18 09:32:01 EDT 2001


Hi all, wondering if someone has such a beast they're willing to share.
Basically something that, given an arbitrary "name" by the user, eliminates
all system-specific special characters (i.e. on Win32 and Mac, lets " "
characters through, but not on *nix).  Will settle for Win32 specific if I
have to...

os.path.normname( somestring )

or

os.path.escape( somestring )


Or is there a canonical place one can get the "special chars" for an OS for
use in string-module-based escaping?

Inquiring minds...
Mike





More information about the Python-list mailing list