mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +00:00
community[patch]: Fix pwd import that is not available on windows (#17532)
- **Description:** Resolving problem in `langchain_community\document_loaders\pebblo.py` with `import pwd`. `pwd` is not available on windows. import moved to try catch block - **Issue:** #17514
This commit is contained in:
parent
91bcc9c5c9
commit
7ae3ce60d2
@ -2,7 +2,6 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import pwd
|
||||
import uuid
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Iterator, List
|
||||
@ -260,6 +259,8 @@ class PebbloSafeLoader(BaseLoader):
|
||||
str: Name of owner.
|
||||
"""
|
||||
try:
|
||||
import pwd
|
||||
|
||||
file_owner_uid = os.stat(file_path).st_uid
|
||||
file_owner_name = pwd.getpwuid(file_owner_uid).pw_name
|
||||
except Exception:
|
||||
|
Loading…
Reference in New Issue
Block a user