Message206580
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. |
|
Date |
User |
Action |
Args |
2013-12-19 05:46:30 | paul.j3 | set | recipients:
+ paul.j3, Julian, berker.peksag, garthy |
2013-12-19 05:46:30 | paul.j3 | set | messageid: <1387431990.2.0.122596221547.issue19959@psf.upfronthosting.co.za> |
2013-12-19 05:46:30 | paul.j3 | link | issue19959 messages |
2013-12-19 05:46:29 | paul.j3 | create | |
|