Skip to content

Not guarding env value in subprocess.py cause python crash when certain env variable is set to None #99238

@tianrui-wei

Description

@tianrui-wei

Bug report

A minimal bug can be found using the following file

from subprocess import Popen, PIPE

env = {}
env["a"] = None
process = Popen(['echo', '"hello"'], stdout=PIPE, stderr=PIPE, env = env)
stdout, stderr = process.communicate()

Your environment

M1 MacOS Monterey, python 3.10
x86_64 Ubuntu 20.04 LTS, python 3.11 (installed via pyenv)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions