]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-14156: Make argparse.FileType work correctly for binary file modes when argument...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 6 Mar 2022 12:12:06 +0000 (04:12 -0800)
committerGitHub <noreply@github.com>
Sun, 6 Mar 2022 12:12:06 +0000 (04:12 -0800)
commitee18df425209cfa4f394b57220177c168fc3a1da
tree025b4e50a6063a616436aa59ba77d102df180838
parent4716f70c8543d12d18c64677af650d479b99edac
bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165)

Also made modes containing 'a' or 'x' act the same as a mode containing 'w' when argument is '-'
(so 'a'/'x' return sys.stdout like 'w', and 'ab'/'xb' return sys.stdout.buffer like 'wb').
(cherry picked from commit eafec26ae5327bb23b6dace2650b074c3327dfa0)

Co-authored-by: MojoVampire <shadowranger+github@gmail.com>
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2019-05-07-14-25-45.bpo-14156.0FaHXE.rst [new file with mode: 0644]