[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-12-16 Thread Lucas Maystre
Lucas Maystre added the comment: Sorry for the little glitches you had to fix, I wonder why I didn't catch them. Anyways, thanks Petri! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-12-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset d5a0698a8354 by Petri Lehtinen in branch 'default': #11175: argparse.FileType now accepts encoding and errors arguments. http://hg.python.org/cpython/rev/d5a0698a8354 -- nosy: +python-dev ___ Python

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-12-15 Thread Petri Lehtinen
Petri Lehtinen added the comment: Committed, thanks for the patch! I made little tweaks before committing: - changed l1 to UTF-8 in the example (guess you mis-uploaded the latest version) - changed the argument to 'replace' in test_r_1_replace - fixed 3-space indentation to 4-space indentation

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-12-02 Thread Lucas Maystre
Lucas Maystre added the comment: As per Ezio's comment, changed l1 to utf-8 in the example of the doc. -- Added file: http://bugs.python.org/file28195/filetype11175.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-11-27 Thread Lucas Maystre
Lucas Maystre added the comment: OK, I'll give it a try. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___ ___ Python-bugs-list mailing

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-11-27 Thread Lucas Maystre
Lucas Maystre added the comment: Added some documentation for the patch. Let me know what you think. -- Added file: http://bugs.python.org/file28139/filetype11175.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-11-26 Thread Lucas Maystre
Lucas Maystre added the comment: Is there something I can do something to move this forward? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-11-26 Thread Petri Lehtinen
Petri Lehtinen added the comment: Since Steven is not responding, I think I can commit it at some point. Thanks for the remainder :) -- assignee: - petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-11-26 Thread Chris Jerdonek
Chris Jerdonek added the comment: The patch needs documentation, though, right? http://docs.python.org/dev/library/argparse.html#filetype-objects -- nosy: +chris.jerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-11-26 Thread Petri Lehtinen
Petri Lehtinen added the comment: Right, good point. Lucas, could you fix the documentation too? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-26 Thread Lucas Maystre
Lucas Maystre added the comment: Alright, here's a version with more tests (unittest.mock is awesome!). I think it tests exactly what it should (and no more), i.e. that the arguments are correctly passed to `open`. -- Added file: http://bugs.python.org/file27729/filetype11175.patch

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-26 Thread Petri Lehtinen
Petri Lehtinen added the comment: LGTM. Let's wait for Steven's comments as he's the maintainer of argparse. -- keywords: +needs review stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-26 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: -berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___ ___

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-24 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___ ___

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-23 Thread Lucas Maystre
Lucas Maystre added the comment: Here's an attempt at implementing this (my first contribution). Some notes: - I tried to keep `__repr__()` backwards compatible. It would have been easier to inherit from `_AttributeHolder`, but maybe this might break some things... - I added some test cases

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-23 Thread Petri Lehtinen
Petri Lehtinen added the comment: Lucas: You only added tests for the repr, you should probably test the actual new functionality, too. -- nosy: +petri.lehtinen stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-23 Thread Lucas Maystre
Lucas Maystre added the comment: OK, as discussed offline with Petri I'll put some tests to ensure that open() is called the right way (using unittest.mock.patch). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175

[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-10-18 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___ ___

[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-12-12 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berkerpeksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___ ___

[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-07-19 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- keywords: +easy nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11175 ___ ___

[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-02-10 Thread Steven Bethard
New submission from Steven Bethard steven.beth...@gmail.com: Suggestion from a personal email: Allow FileType to accept encoding and errors arguments and pass these as keyword arguments to codecs.open() instead of open(). -- components: Library (Lib) messages: 128301 nosy: bethard

[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-02-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The encoding and errors arguments are probably useful, but why would you use the codecs module? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org

[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-02-10 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Probably because the suggestion came from someone thinking about both Python 2 and 3. But given that this feature request can only target Python 3.3, you're absolutely right that there's no need to go through the codecs module.