对于文件类型的参数,`lazy` 在 Windows 上不起作用
作者: andgineer创建于 2023年1月8日更新于 2026年8月29日
标签parsing
@click.argument( "csv_file", default="goodreads_library_export.csv", type=click.File( "r", lazy=True, ), nargs=1, ) 在 Linux 上,如果我没有打开文件,即使没有此文件,也会正常运行。但在 Windows 中,它会失败 https://GitHub.com/andgineer/goodreads-export/actions/runs/3867907090/jobs/6593008354 "用法: main [OPTIONS] [CSV_FILE] 尝试 'main --help' 获取帮助。 错误: '[CSV_FILE]' 的值无效: 'goodreads_library_export.csv': 找不到此文件或目录"
内容来源: pallets/click