Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running a background process, always inherit env #3603

Merged

Conversation

trygveaa
Copy link
Sponsor Contributor

@trygveaa trygveaa commented May 9, 2021

subprocess.Popen inherits the current environment if you pass env=None,
but only sets the environment you pass when you pass something else.
This causes an issue with using launch with --stdin-source and
--type=background, e.g. that DISPLAY is not set so you can't launch
graphical processes. Therefore, we have to include os.environ when we
pass an env to Popen.

Fixes #3602

subprocess.Popen inherits the current environment if you pass env=None,
but only sets the environment you pass when you pass something else.
This causes an issue with using launch with --stdin-source and
--type=background, e.g. that DISPLAY is not set so you can't launch
graphical processes. Therefore, we have to include os.environ when we
pass an env to Popen.

Fixes kovidgoyal#3602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not launch a program with the --type=background option
2 participants