Skip to content

Subprocess stdin does not allow tempfile.SpooledTemporaryFile #101136

@zackees

Description

@zackees

Bug report

It appears that subprocess.Popen does not accept a stdin stream of type SpooledTemporaryFile and just fails. I've gone ahead and created a public unit test showing this in action. It fails on all MacOS/Windows10/Ubuntu. However, switching from SpooledTemporaryFile to an actual named file or a tempfile.TemporaryFile works just fine.

See bug repro case here:
https://github.com/zackees/python-subprocess-bug-spooled-temp-file

I'm not sure if this is a bug or intended behavior. Feel free to close if this is intended behavior.

Your environment

The test for SpooledTemporaryFile fails on Windows10, MacOS and Ubuntu using python 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions