You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on python 3.12 (at least, have not tested 3.11), using rglob() leads to this:
/usr/lib/python3.12/pathlib.py:169: RuntimeWarning: coroutine 'AsyncPath.is_dir' was never awaited
if not parent_path.is_dir():
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sample code:
async def _list_directory_async_recursive(path: str, mask: str = None, files_only: bool = False) -> list[str]:
paths = []
if mask is None:
mask = '*'
p: AsyncPath = AsyncPath(path)
async for pp in p.rglob(mask):
if files_only and await pp.is_dir():
# skip directories
continue
paths.append(str(pp))
return paths
glob() seems unaffected.
a simple fix is, in aiopath.path.py, to change this:
if you agree, i could make a PR. i also see the same pattern with super() is used in other functions in aiopath.path.py, though i have not tested if they have the same issue.
The text was updated successfully, but these errors were encountered:
on python 3.12 (at least, have not tested 3.11), using rglob() leads to this:
sample code:
glob() seems unaffected.
a simple fix is, in aiopath.path.py, to change this:
to this
if you agree, i could make a PR. i also see the same pattern with super() is used in other functions in aiopath.path.py, though i have not tested if they have the same issue.
The text was updated successfully, but these errors were encountered: