os.listdir compatibility solved