This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zygocephalus
Recipients josh.r, mangrisano, paul.j3, zygocephalus
Date 2019-06-04.23:50:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
If you will run `python hello.txt, where is:

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('echo', type=argparse.FileType)
args = parser.parse_args()

You will receive:

I think that can be confusing for someone who will forget to invoke FileType constructor.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, June 4, 2019 10:27 PM, Michele Angrisano <> wrote:

> Michele added the comment:
> Reading the examples in the doc, it's clear the behavior when FileType takes an argument. What's the behavior of FileType when is called without any argument?
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
> nosy: +mangrisano
> Python tracker
Date User Action Args
2019-06-04 23:50:25zygocephalussetrecipients: + zygocephalus, paul.j3, josh.r, mangrisano
2019-06-04 23:50:25zygocephaluslinkissue37150 messages
2019-06-04 23:50:25zygocephaluscreate