diff options
author | ddthj <ddthj@users.noreply.github.com> | 2022-11-03 17:11:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 17:11:51 -0500 |
commit | 5c2d23b29430988b891f47065fbf780259ad81c4 (patch) | |
tree | aa2b711a9f942f28380cc2d32bde9949be608ec1 | |
parent | d0ad46eb92071c5e4af92fffe7821f7e1e316342 (diff) | |
parent | 6124f91ae577ffb834cd6bf4f11b37680d960148 (diff) |
Merge pull request #601 from VirxEC/pipe-stdin
Make sure stdin is never inherited when spawning subprocess
-rw-r--r-- | src/main/python/rlbot/setup_manager.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/python/rlbot/setup_manager.py b/src/main/python/rlbot/setup_manager.py index 11bfa1d4..b107541f 100644 --- a/src/main/python/rlbot/setup_manager.py +++ b/src/main/python/rlbot/setup_manager.py @@ -338,7 +338,7 @@ class SetupManager: checked_environment_requirements = set() online = True except URLError: - print("The user is offline, skipping upgrade the bot requirements") + self.logger.warn("The user is offline, skipping upgrade the bot requirements") online = False for bundle in self.bot_bundles: @@ -548,7 +548,7 @@ class SetupManager: '--player-index', str(participant_index), '--spawn-id', str(spawn_id), '--matchcomms-url', self.matchcomms_server.root_url.geturl() - ], cwd=Path(bundle.config_directory).parent) + ], cwd=Path(bundle.config_directory).parent, stdin=subprocess.PIPE) self.bot_processes[participant_index] = BotProcessInfo(process=None, subprocess=process, player_config=player_config) # Insert immediately into the agent metadata map because the standalone process has no way to communicate it back out @@ -590,7 +590,8 @@ class SetupManager: script_config_bundle.script_file, '--matchcomms-url', self.matchcomms_server.root_url.geturl() ], - cwd=Path(script_config_bundle.config_directory).parent + cwd=Path(script_config_bundle.config_directory).parent, + stdin=subprocess.PIPE ) self.logger.info(f"Started script with pid {process.pid} using {process.args}") self.script_processes[process.pid] = process |