Skip to content

gh-58032: Do not use argparse.FileType in module CLIs and scripts#113649

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:no-FileType
Jan 10, 2024
Merged

gh-58032: Do not use argparse.FileType in module CLIs and scripts#113649
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:no-FileType

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jan 2, 2024

Copy link
Copy Markdown
Member

Open and close files manually. It prevents from leaking files, preliminary creation of output files, and accidental closing of stdin and stdout.

See also #113618 which does this for pickle and pickletools CLIs.

Open and close files manually. It prevents from leaking files,
preliminary creation of output files, and accidental closing of stdin
and stdout.
@serhiy-storchaka
serhiy-storchaka merged commit b3d2427 into python:main Jan 10, 2024
@serhiy-storchaka
serhiy-storchaka deleted the no-FileType branch January 10, 2024 13:07
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
…ts (pythonGH-113649)

Open and close files manually. It prevents from leaking files,
preliminary creation of output files, and accidental closing of stdin
and stdout.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…ts (pythonGH-113649)

Open and close files manually. It prevents from leaking files,
preliminary creation of output files, and accidental closing of stdin
and stdout.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…ts (pythonGH-113649)

Open and close files manually. It prevents from leaking files,
preliminary creation of output files, and accidental closing of stdin
and stdout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants