-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-136156: Allow using linkat() with TemporaryFile #136281
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
Conversation
tempfile.TemporaryFile() no longer uses os.O_EXCL with os.O_TMPFILE, so it's possible to use linkat() on the file descriptor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Could you add a test using the proc filesystem? I tried to implement AT_EMPTY_PATH support (see #89341), but it only works for root. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
@@ -1594,6 +1594,29 @@ def test_unexpected_error(self): | |||
mock_close.assert_called() | |||
self.assertEqual(os.listdir(dir), []) | |||
|
|||
@unittest.skipUnless(tempfile._O_TMPFILE_WORKS, 'need os.O_TMPFILE') | |||
@unittest.skipUnless(os.path.exists('/proc/self/fd'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe even isdir()
?
!buildbot BSD |
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit c912963 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136281%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
I tested manually: the test is skipped since |
Merged, thanks for review @serhiy-storchaka. |
|
Oh, the test fails with PermissionError on Android:
|
I wrote #136430 to fix the test on Android. |
|
Oh. The test fails on Arch Linux buildbots: https://buildbot.python.org/#/builders/582/builds/6857
|
tempfile.TemporaryFile() no longer uses os.O_EXCL with os.O_TMPFILE, so it's possible to use linkat() on the file descriptor.
tempfile.TemporaryFile() no longer uses os.O_EXCL with os.O_TMPFILE, so it's possible to use linkat() on the file descriptor.
tempfile.TemporaryFile() no longer uses os.O_EXCL with os.O_TMPFILE, so it's possible to use linkat() on the file descriptor.