#2429·click

for argument type File, `lazy` does not work on Windows

Author: andgineerCreated Jan 8, 2023Updated Aug 29, 2026
Labelsparsing

@click.argument( "csv_file", default="goodreads_library_export.csv", type=click.File( "r", lazy=True, ), nargs=1, )

That work as expected in Linux - if I do not open the file it works even if there is no such file. But in Windows it fails https://github.com/andgineer/goodreads-export/actions/runs/3867907090/jobs/6593008354 `Usage: main [OPTIONS] [CSV_FILE] Try 'main --help' for help.

Error: Invalid value for '[CSV_FILE]': 'goodreads_library_export.csv': No such file or directory`

Environment:

  • Python version: 3.9
  • Click version: 8.1.3