]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-14156: Make argparse.FileType work correctly for binary file modes when argument...
authorMojoVampire <shadowranger+github@gmail.com>
Sun, 6 Mar 2022 11:49:42 +0000 (11:49 +0000)
committerGitHub <noreply@github.com>
Sun, 6 Mar 2022 11:49:42 +0000 (13:49 +0200)
commiteafec26ae5327bb23b6dace2650b074c3327dfa0
tree4b29c9a699bd802142c29a07f5e7f99afdc0b162
parent602024e6e12c69d836aa191d63db75862aec2493
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').
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]