Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdks/python/apache_beam/yaml/yaml_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,10 @@ def _create_venv_from_scratch(
subprocess.run([venv_pip, 'install'] + packages, check=True)
with open(venv + '-requirements.txt', 'w') as fout:
fout.write('\n'.join(packages))
except: # pylint: disable=bare-except
except Exception as e:
logging.warning("Failed to create venv %s from scratch: %s", venv, e, exc_info=True)
Copy link
Contributor

@Abacn Abacn Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_create_venv_from_scratch will return a non-existing path, and will fail elsewhere, even more difficult to debug if it happens.

I think no more action is needed. The dependency is added after #34073

if os.path.exists(venv):
shutil.rmtree(venv, ignore_errors=True)
raise
return venv

@classmethod
Expand All @@ -1204,10 +1204,10 @@ def _create_venv_from_clone(
subprocess.run([venv_pip, 'install'] + packages, check=True)
with open(venv + '-requirements.txt', 'w') as fout:
fout.write('\n'.join(packages))
except: # pylint: disable=bare-except
except Exception as e:
logging.warning("Failed to create venv %s from clone: %s", venv, e, exc_info=True)
if os.path.exists(venv):
shutil.rmtree(venv, ignore_errors=True)
raise
return venv

@classmethod
Expand Down
Loading