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

No implementation of cwd or abspath? #181

Closed
GodefroyClair opened this issue May 31, 2024 · 2 comments · Fixed by #182
Closed

No implementation of cwd or abspath? #181

GodefroyClair opened this issue May 31, 2024 · 2 comments · Fixed by #182

Comments

@GodefroyClair
Copy link
Contributor

If I'm not mistaken, neitherget_cwd nor abspath (which is juste normpath(join(os.getcwd(), path)) according to the doc in the os package) are implemented in aiofiles.
It seems like important function that do IO operations if I'm not mistaken. Is there a fundamental reason why it is not implemented in aiofiles?
Thanks!

@Tinche
Copy link
Owner

Tinche commented May 31, 2024

There's no fundamental reason. Are get_cwd and abspath blocking in the first place?

Probably no one asked for it or contributed it. If you feel like adding it (should be fairly simple) feel free to send a PR!

@GodefroyClair
Copy link
Contributor Author

Well, abspath calls getcwd and, on Linux,getcwdcalls the POSIX functon getcwd. This function is a system call.
Exactly what implementation is behind that is beyond my knowledge. How would you evaluate how "blocking" a function is ?
https://hg.python.org/cpython/file/tip/Modules/posixmodule.c
https://man7.org/linux/man-pages/man3/getcwd.3.html

...and yes, if needed, I would be very happy to help and send a PR...

@Tinche Tinche linked a pull request Jun 7, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants