[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-05 Thread Demid
Demid added the comment: What if I will add mode check in FileType.__init__? -- ___ Python tracker <https://bugs.python.org/issue37150> ___ ___ Python-bug

[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-04 Thread Demid
Demid added the comment: If you will run `python test.py hello.txt, where test.py is: import argparse parser = argparse.ArgumentParser() parser.add_argument('echo', type=argparse.FileType) args = parser.parse_args() print(args.echo) You will receive: FileType('hello.txt') I think that can

[issue37144] tarfile.open: improper handling of path-like object

2019-06-04 Thread Demid
Change by Demid : -- keywords: +patch pull_requests: +13703 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13817 ___ Python tracker <https://bugs.python.org/issu

[issue37144] tarfile.open: improper handling of path-like object

2019-06-04 Thread Demid
Change by Demid : -- nosy: +dm ___ Python tracker <https://bugs.python.org/issue37144> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue37144] tarfile.open: improper handling of path-like object

2019-06-04 Thread Demid
Change by Demid : -- nosy: +zygocephalus -dm ___ Python tracker <https://bugs.python.org/issue37144> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-04 Thread Demid
Change by Demid : -- keywords: +patch pull_requests: +13690 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13805 ___ Python tracker <https://bugs.python.org/issu

[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-04 Thread Demid
New submission from Demid : There is a possibility that someone (like me) accidentally will omit parentheses with FileType arguments after FileType, and parser will contain wrong file until someone will try to use it. Example: parser = argparse.ArgumentParser() parser.add_argument('-x