use `os.path.splitext`