You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/27 04:49:08 UTC

[GitHub] [airflow] MatrixManAtYrService opened a new pull request, #25331: BashOperator - resolve bash by absolute path

MatrixManAtYrService opened a new pull request, #25331:
URL: https://github.com/apache/airflow/pull/25331

   Fixes https://github.com/apache/airflow/issues/25330
   
   Necessary because maybe the user sets `env` but doesn't set `PATH`.  Now `PATH` is empty and the subprocess can't find bash.  I'm a little confused why this is not a more common failure mode, does `subprocess` have a list of default locations to look or something?
   
   Existing tests of BashOperator should be sufficient.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #25331: BashOperator - resolve bash by absolute path

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #25331:
URL: https://github.com/apache/airflow/pull/25331#issuecomment-1196704915

   > This is also mentioned in the subprocess documentation: https://docs.python.org/3.10/library/subprocess.html#subprocess.Popen
   
   TIL. Thanks @MatrixManAtYrService and @uranusjr for nice discussion on it  and links :)


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on pull request #25331: BashOperator - resolve bash by absolute path

Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #25331:
URL: https://github.com/apache/airflow/pull/25331#issuecomment-1196267728

   > I'm a little confused why this is not a more common failure mode, does subprocess have a list of default locations to look or something?
   
   Yes. When you supply a “bare“ command (instead of a path), `subprocess` relies on the OS to look up the actual executable. This is the same as looking up in `PATH` _most of the time_, but also depends on a bunch of other run-time configurations set in the OS. So the general suggestion is to always pass in a pre-resolved path instead of a bare command, since it is the behaviour most people expect in most situations, unless you are actively trying to replicate the OS behaviour down to implementation details.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk merged pull request #25331: BashOperator - resolve bash by absolute path

Posted by GitBox <gi...@apache.org>.
potiuk merged PR #25331:
URL: https://github.com/apache/airflow/pull/25331


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org