Thanks to visit codestin.com
Credit goes to github.com

Skip to content

subprocess.check_call's stdout= write to the underlying file opened by bz2.open #105309

Open
@grapland0

Description

@grapland0
with bz2.open("abc.bz2", "wb") as fo:
    subprocess.check_call(["blah","blah"], stdout=fo)

Expected: abc.bz2 contains compressed data from subprocess.
Actual: abc.bz2 contains uncompressed data from subprocess.

cpython 3.11.3, linux 5.4.0-1109-azure

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-subprocessSubprocess issues.type-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions