From cad975587f91ca2c9dde0ccaaaa75aa33a39554c Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Thu, 12 Nov 2026 14:29:41 +0400 Subject: [PATCH] The parameter receives an open file object, not a path --- docs/handling-files.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/handling-files.md b/docs/handling-files.md index 782a1a5bc..261ce8a08 100644 --- a/docs/handling-files.md +++ b/docs/handling-files.md @@ -18,6 +18,9 @@ Click supports working with files with the {class}`File` type. Some notable feat This is a common pattern for POSIX command line utilities. - Deals with `str` and `bytes` correctly for all versions of Python. +The command receives each file as a file object, which it can read or write directly. To get the path given on the +command line, use the {class}`Path` type. + Example: ```{eval-rst}