-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Python 3.10 alpha 7 introduces new changes to pathlib #4
Comments
The specific error in this ticket is fixed in this branch: https://github.com/alexdelorenzo/aiopath/tree/Python-3.10 Versions |
Using the latest branch of pytest (via https://github.com/pytest-dev/pytest) with 3.10 support, it appears that the coroutine method ______________________________________________________________________________ test_home ______________________________________________________________________________
@pytest.mark.asyncio
async def test_home():
home = Path.home()
ahome = await AsyncPath.home()
> await _test_is(home, ahome)
tests.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests.py:67: in _test_is
await _test_is(path.parent, apath.parent, test_parent=False)
tests.py:74: in _test_is
await apath.resolve(),
aiopath/path.py:491: in resolve
s: Optional[str] = await self._flavour.resolve(self, strict=strict)
aiopath/flavours.py:90: in resolve
result = await _resolve(base, str(path))
aiopath/flavours.py:73: in _resolve
target = await accessor.readlink(newpath)
../../../.pyenv/versions/3.10-dev/lib/python3.10/site-packages/aiofiles/os.py:13: in run
return await loop.run_in_executor(executor, pfunc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = None
def run(self):
if not self.future.set_running_or_notify_cancel():
return
try:
> result = self.fn(*self.args, **self.kwargs)
E TypeError: readlink() takes exactly 1 positional argument (2 given)
../../../.pyenv/versions/3.10-dev/lib/python3.10/concurrent/futures/thread.py:52: TypeError |
Just some notes for myself: I started this project as a fork of It might be worth profiling That way I'm not beholden to upstream maintainers' changes in the stdlib, and as long as the API stays the same, The downside is punting some CPU-bound code to the threadpool, which, all in all, probably has an insignificant overhead. It can also introduce problems like these:
However, Barney Gale's updates to In a world with an extensible |
I'm sorry my changes have broken things! As always with extending private APIs in the standard library, it can be a bit of a minefield. As you mentioned, I'm working towards a |
The following works on alpha 6 and below, but alpha 7 introduces this error:
The text was updated successfully, but these errors were encountered: