Function
read_text_async
(path: Union[str, Path], encoding: str = "utf-8")
Source from the content-addressed store, hash-verified
| 34 | |
| 35 | |
| 36 | async def read_text_async(path: Union[str, Path], encoding: str = "utf-8") -> str: |
| 37 | try: |
| 38 | async with aiofiles.open(path, "r", encoding=encoding) as f: |
| 39 | return await f.read() |
| 40 | except Exception as e: |
| 41 | logger.error(f"Failed to read text from {path}: {e}") |
| 42 | raise |
| 43 | |
| 44 | |
| 45 | async def write_text_async(path: Union[str, Path], content: str, encoding: str = "utf-8"): |
Callers
nothing calls this directly
Tested by
no test coverage detected