Skip to content

fix(list_dir): add isdir check before listing#1540

Merged
bryanadenhq merged 1 commit intoaden-hive:mainfrom
jaffarkeikei:fix/list-dir-isdir-check
Jan 28, 2026
Merged

fix(list_dir): add isdir check before listing#1540
bryanadenhq merged 1 commit intoaden-hive:mainfrom
jaffarkeikei:fix/list-dir-isdir-check

Conversation

@jaffarkeikei
Copy link
Copy Markdown

Description

Fixed list_dir crash when given a file path instead of a directory by adding os.path.isdir() validation.

Type of Change

  • Bug fix

Related Issues

Fixes #1401

Changes Made

  • Added os.path.isdir() check after path existence validation
  • Updated error messages: "Path not found" for missing paths, "Path is not a directory" for files
  • Prevents NotADirectoryError exception

Testing

  • Manual testing: verified error handling for non-existent paths, files, and valid directories

Copy link
Copy Markdown
Collaborator

@bryanadenhq bryanadenhq left a comment

Choose a reason for hiding this comment

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

looks good, thanks for contributing!

@bryanadenhq bryanadenhq merged commit 2a049df into aden-hive:main Jan 28, 2026
4 checks passed
jhalak999 pushed a commit to jhalak999/hive that referenced this pull request Feb 17, 2026
…r-check

fix(list_dir): add isdir check before listing
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.

[Bug]: list_dir crashes with NotADirectoryError when path is a file

2 participants