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

aioftp.errors.PathIsNotAbsolute: E:\PythonPrj\6xx\serverFile\recvFiles\客户端30 #161

Closed
honglei opened this issue Apr 24, 2023 · 2 comments

Comments

@honglei
Copy link

honglei commented Apr 24, 2023

Env: Python3.11.3/Win10

Error:

 File "e:\pythonprj\6xx\crud_test\aioftp_server_recv.py", line 53, in <module>
  asyncio.run(main())
File "c:\python311\lib\asyncio\runners.py", line 190, in run
  return runner.run(main)
File "c:\python311\lib\asyncio\runners.py", line 118, in run
  return self._loop.run_until_complete(task)
File "c:\python311\lib\asyncio\base_events.py", line 653, in run_until_complete
  return future.result()
 File "e:\pythonprj\6xx\crud_test\aioftp_server_recv.py", line 38, in main
  aioftpUser = aioftp.User(
File "c:\python311\lib\site-packages\aioftp\server.py", line 132, in __init__
  raise errors.PathIsNotAbsolute(home_path)

aioftp.errors.PathIsNotAbsolute: E:\PythonPrj\6xx\serverFile\recvFiles\客户端30

self.home_path = pathlib.PurePosixPath(home_path)

should be:

self.home_path = pathlib.PurePosixPath(home_path) if sys.platform == 'posix' else pathlib.WindowsPath(home_path)
@pohmelie
Copy link
Collaborator

I think you pass home_path instead of base_path. Check to docs: https://aioftp.readthedocs.io/server_api.html#aioftp.User

@honglei honglei closed this as completed Apr 25, 2023
@honglei
Copy link
Author

honglei commented Apr 25, 2023

Thanks. I misunderstood the name of home_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants