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 paul.j3
Recipients Julian, berker.peksag, garthy, paul.j3
Date 2013-12-19.05:46:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387431990.2.0.122596221547.issue19959@psf.upfronthosting.co.za>
In-reply-to
Content
Normally the unix shell takes care of this expansion.  If I call a simple script that prints sys.argv and runs a simple parser, I get:

    2135:~/mypy$ python2.7 filetypetest.py ~/mypy/test.txt
    ['filetypetest.py', '/home/paul/mypy/test.txt']
    Namespace(file=<open file '/home/paul/mypy/test.txt', mode 'r'...)

I have to quote the argument '~/mypy/test.blog' to bypass this expansion.

This is under Linux (bash).  Is Windows or Mac different?

My impression is that `FileType` has been provided as an example of a custom `type`, as opposed to a comprehensive file handler.  But I can't quote a developer on this.  

http://bugs.python.org/issue13824 is a bug report that worries that 'argparse.FileType opens a file and never closes it'.  There are some comments there about whether it is appropriate to expand on the capabilities of FileType.
History
Date User Action Args
2013-12-19 05:46:30paul.j3setrecipients: + paul.j3, Julian, berker.peksag, garthy
2013-12-19 05:46:30paul.j3setmessageid: <1387431990.2.0.122596221547.issue19959@psf.upfronthosting.co.za>
2013-12-19 05:46:30paul.j3linkissue19959 messages
2013-12-19 05:46:29paul.j3create