Llamparse within SimpledirectoryReader doesn't accept PurePosixPath #284

Closed
opened 2026-02-16 00:17:22 -05:00 by yindo · 0 comments
Owner

Originally created by @seeifsalem on GitHub (Oct 1, 2024).

Describe the bug
I am using LlamaParse as an extractor within a SimpleDirectoryReader with fs as an s3 bucket. What will happen is that when load_data() from LlamaParse is called, the file_path will be a PurePosixPath (because of the design of SimpleDirectoryReader).
_Path = Path if is_default_fs(self.fs) else PurePosixPath

The problem is that in llama_parse\base.py line 367 we have this check
if isinstance(file_path, (str, Path, bytes, BufferedIOBase)):
It doesn't include PurePosixPath as an accepted instance so we can't load our files.

This should be an easy fix:
if isinstance(file_path, (str, Path, PurePosixPath, bytes, BufferedIOBase)):

Originally created by @seeifsalem on GitHub (Oct 1, 2024). **Describe the bug** I am using LlamaParse as an extractor within a SimpleDirectoryReader with fs as an s3 bucket. What will happen is that when load_data() from LlamaParse is called, the file_path will be a PurePosixPath (because of the design of SimpleDirectoryReader). `_Path = Path if is_default_fs(self.fs) else PurePosixPath` The problem is that in llama_parse\base.py line 367 we have this check [`if isinstance(file_path, (str, Path, bytes, BufferedIOBase)):`](https://github.com/run-llama/llama_parse/blob/2ccd2a9397ca478a3539e41fb274ffd37f03f45b/llama_parse/base.py#L367) It doesn't include PurePosixPath as an accepted instance so we can't load our files. This should be an easy fix: ` if isinstance(file_path, (str, Path, PurePosixPath, bytes, BufferedIOBase)): `
yindo added the bug label 2026-02-16 00:17:22 -05:00
yindo closed this issue 2026-02-16 00:17:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#284