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
add dir_fd for mkstemp, and also maybe to all tempfile.* #70115
Comments
dir_fd support is good in |
Do you want to provide a patch Mark? |
Yes, can I do it on, say, github ? |
See a guide: https://docs.python.org/devguide/. |
I started looking at this issue. I may need to propagate the change (adding dir_fd as a keyword argument) to multiple functions in posixpath module: Functions like abspath, join, isdir, etc. The alternative will be to have the logic in tempfile module which feels off to me. Does anyone have an issue with that ? |
I think it is better to not change posixpath for now. And it is not necessary. But shutil.rmtree() needs to support file descriptors, and it is not trivial issue. |
I have also almost finished this issue (only needed to add some tests and docs). |
Alright, I'll stop working on it then, thanks for the fix ! |
There are two ways of supporting an open file descriptor to a directory:
The original proposition is option 2. PR 31785 implements option 1. I am going to play with the code, implement option 2, and see what is simpler and what is more convenient. Any thoughts or suggestions? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: