Skip to content

[3.9] bpo-14156: Make argparse.FileType work correctly for binary fil…#31979

Merged
serhiy-storchaka merged 1 commit intopython:3.9from
serhiy-storchaka:backport-eafec26-3.9
Mar 18, 2022
Merged

[3.9] bpo-14156: Make argparse.FileType work correctly for binary fil…#31979
serhiy-storchaka merged 1 commit intopython:3.9from
serhiy-storchaka:backport-eafec26-3.9

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Mar 18, 2022

…e 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 eafec26)

Co-authored-by: MojoVampire shadowranger+github@gmail.com

https://bugs.python.org/issue14156

…e modes when argument is '-' (pythonGH-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 eafec26)

Co-authored-by: MojoVampire <shadowranger+github@gmail.com>
@serhiy-storchaka serhiy-storchaka merged commit 4d2099f into python:3.9 Mar 18, 2022
@serhiy-storchaka serhiy-storchaka deleted the backport-eafec26-3.9 branch March 18, 2022 18:54
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…e modes when argument is '-' (pythonGH-13165) (pythonGH-31979)

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 eafec26)

Co-authored-by: MojoVampire <shadowranger+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants