[issue19959] argparse.FileType does not expand tilde "~"

Julian Berman report at bugs.python.org
Mon Mar 28 08:19:49 EDT 2016


Julian Berman added the comment:

My support (or really, asking for a more generic callable) was to enable other use cases, not this one specifically -- e.g., allowing for constructing a pathlib Path or a twisted.python.filepath.FilePath without needing to write one's own argparse action.

For ~ specifically -- it's true if you're going to go via a shell it'd be expanded first, but I'm not sure that'd count as "conflicting" with the shell's expansion, it just won't be needed. Consider that twisted.python.filepath.FilePath for example, expands ~ in its constructor -- people often construct paths in other places and occasionally expansion is convenient. Like in test cases.

I certainly don't feel strongly about the patch though, especially as-is.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19959>
_______________________________________


More information about the Python-bugs-list mailing list