Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

argparse: Check if stderr is defined before writing to it #101640

Closed
Assignees
terryjreedy
Labels
OS-windowspendingThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or error
@simaoafonso-pwt

Description

@simaoafonso-pwt

Bug report

argparse tries to write to stderr inconditionally, even when it'sNone. This is only a problem on Windows. Here:

https://github.com/python/cpython/blob/3.11/Lib/argparse.py#L2596-L2600

I detected this when usingPyInstaller to create a binary on Windows using--noconsole, which triggers usingpythonw.exe. In this case,sys.stderr is None.

This is similar to#89057

Your environment

  • Any version of Python on Windows, up to 3.11

Linked PRs

Metadata

Metadata

Assignees

Labels

OS-windowspendingThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or error

Projects

Status

Doc issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp