validate a filename in python,"return os.path.join(directory, filename)"