casra-developers commented on a change in pull request #16110:
URL: https://github.com/apache/airflow/pull/16110#discussion_r640676744
##########
File path: airflow/task/task_runner/base_task_runner.py
##########
@@ -133,16 +138,28 @@ def run_command(self, run_with=None):
self.log.info("Running on host: %s", get_hostname())
self.log.info('Running: %s', full_cmd)
- # pylint: disable=subprocess-popen-preexec-fn,consider-using-with
- proc = subprocess.Popen(
- full_cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- universal_newlines=True,
- close_fds=True,
- env=os.environ.copy(),
- preexec_fn=os.setsid,
- )
+
+ if is_windows():
+ # pylint: disable=subprocess-popen-preexec-fn,consider-using-with
+ proc = subprocess.Popen(
+ full_cmd,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ universal_newlines=True,
+ close_fds=True,
+ env=os.environ.copy()
+ )
+ else:
+ # pylint: disable=subprocess-popen-preexec-fn,consider-using-with
+ proc = subprocess.Popen(
+ full_cmd,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ universal_newlines=True,
+ close_fds=True,
+ env=os.environ.copy(),
+ preexec_fn=os.setsid, # does not exist on Windows
+ )
Review comment:
Seems to work, I will change it. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]