diff --git a/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/docs/base.py b/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/docs/base.py index 6a75489ffdc87..86864013dd4d5 100644 --- a/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/docs/base.py +++ b/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/docs/base.py @@ -8,7 +8,7 @@ import logging import struct import zlib -from pathlib import Path +from pathlib import Path, PurePosixPath from typing import Any, Dict, List, Optional from tenacity import retry, stop_after_attempt @@ -43,8 +43,8 @@ def load_data( fs: Optional[AbstractFileSystem] = None, ) -> List[Document]: """Parse file.""" - if not isinstance(file, Path): - file = Path(file) + if not isinstance(file, Path) and not isinstance(file, PurePosixPath): + file = PurePosixPath(file) try: import pypdf