Skip to content

Conversation

@SurajBDeore
Copy link
Contributor

Automatically create output directories for all LOBSTER tools to prevent crashes when paths don't exist

Issue: SWF-20884

@SurajBDeore SurajBDeore requested a review from a team as a code owner December 30, 2025 06:11
@SurajBDeore SurajBDeore force-pushed the feature/auto-create-output-directories branch 9 times, most recently from 273f1e0 to 68a5624 Compare December 30, 2025 13:26
@SurajBDeore SurajBDeore force-pushed the feature/auto-create-output-directories branch from 68a5624 to 62aaaeb Compare December 30, 2025 13:29
Comment on lines +601 to +606
def _ensure_output_directory(file_path: str) -> None:
"""Create parent directories for the output file if they don't exist."""
directory = os.path.dirname(file_path)
if directory:
os.makedirs(directory, exist_ok=True)

Copy link
Contributor

Choose a reason for hiding this comment

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

This function is for almost all the tools and can be moved to common location like io.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants