Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed resolve(), absolute(), readlink() calls to _from_parts() #32

Open
wants to merge 1 commit into
base: support-3.11
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aiopath/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __new__(cls: Type[Self], *args, **kwargs) -> Self:
cls = AsyncWindowsPath if IS_WIN else AsyncPosixPath

try:
self = cls._from_parts(args, init=False)
self = cls._from_parts(args)

except TypeError:
self = cls._from_parts(args)
Expand Down Expand Up @@ -218,7 +218,7 @@ async def readlink(self) -> AsyncPath:
Return the path to which the symbolic link points.
"""
path: str = await self._accessor.readlink(self)
obj = self._from_parts((path,), init=False)
obj = self._from_parts((path,))
obj._init(template=self)
return obj

Expand Down Expand Up @@ -467,7 +467,7 @@ async def absolute(self) -> AsyncPath:
# FIXME this must defer to the specific flavour (and, under Windows,
# use nt._getfullpathname())
parts: list[str] = [getcwd()] + self._parts
obj = self._from_parts(parts, init=False)
obj = self._from_parts(parts)
obj._init(template=self)
return obj

Expand All @@ -488,7 +488,7 @@ async def resolve(self, strict: bool = False) -> AsyncPath:

# Now we have no symlinks in the path, it's safe to normalize it.
normed: str = self._flavour.pathmod.normpath(s)
obj = self._from_parts((normed,), init=False)
obj = self._from_parts((normed,))
obj._init(template=self)
return obj

Expand Down