def format_query(query):
    """Helper to strip special characters from filepaths"""
    illegal_chars = [' ', '*', ':', '"', '<', '>', '/', '\\', '|', '?']
    for i in illegal_chars:
        if i in query:
            query = query.replace(i, '_')
    return query
