Skip to content

Replaced os path to pathlib#594

Open
sachichakrabarti wants to merge 4 commits into
mainfrom
internal/replace_ospath_to_pathlib
Open

Replaced os path to pathlib#594
sachichakrabarti wants to merge 4 commits into
mainfrom
internal/replace_ospath_to_pathlib

Conversation

@sachichakrabarti

Copy link
Copy Markdown

Replaced os path to pathlib in 3 files

  1. lobster\common\file_tag_generator.py
  2. lobster\common\io.py
  3. lobster\common\multi_file_input_tool.py

@sachichakrabarti sachichakrabarti requested a review from a team as a code owner June 23, 2026 05:30
@sachichakrabarti sachichakrabarti changed the title Replaced os path to pathlib BUG-Replaced os path to pathlib Jun 23, 2026
@sachichakrabarti sachichakrabarti changed the title BUG-Replaced os path to pathlib Replaced os path to pathlib Jun 23, 2026
Comment thread lobster/common/io.py Outdated
Comment on lines +153 to +156
output_dir = Path(file_path).parent

if output_dir != Path("."):
output_dir.mkdir(parents=True, exist_ok=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can simplify this even further, because calling mkdir for the . path is not a problem when exist_ok=True.

Suggested change
output_dir = Path(file_path).parent
if output_dir != Path("."):
output_dir.mkdir(parents=True, exist_ok=True)
Path(file_path).parent.mkdir(parents=True, exist_ok=True)

This simplification should increase the branch coverage (if it is covered by tests at all...)

@sachichakrabarti sachichakrabarti force-pushed the internal/replace_ospath_to_pathlib branch from d425358 to 55200e6 Compare June 24, 2026 06:19
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.

2 participants