Skip to content

Commit 80734b7

Browse files
authored
Dont fail pipeline on failed stat (#35640)
* Dont fail pipeline on failed stat * scope error
1 parent c537c16 commit 80734b7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sdks/python/apache_beam/runners/portability/prism_runner.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,13 @@ def _prepare_executable(
181181

182182
_LOGGER.info("Prism binary path resolved to: %s", target_url)
183183
# Make sure the binary is executable.
184-
st = os.stat(target_url)
185-
os.chmod(target_url, st.st_mode | stat.S_IEXEC)
184+
try:
185+
st = os.stat(target_url)
186+
os.chmod(target_url, st.st_mode | stat.S_IEXEC)
187+
except PermissionError:
188+
_LOGGER.warning(
189+
'Could not change permissions of prism binary; invoking may fail if '
190+
+ 'current process does not have exec permissions on binary.')
186191
return target_url
187192

188193
@staticmethod

0 commit comments

Comments
 (0)