Sanitizes filename for use on Windows and other brain-dead systems, by replacing a number of illegal characters
    with underscores.

def _sanitizeFilename(filename):
    """Sanitizes filename for use on Windows and other brain-dead systems, by replacing a number of illegal characters
    with underscores."""
    global _sanitize_trans
    out = filename.translate(_sanitize_trans)
    # leading dot becomes "_"
    if out and out[0] == '.':
        out = out[1:]
    return out