Skip to content

bpo-42780: fix set_inheritable() for O_PATH file descriptors on Linux#24172

Merged
vstinner merged 3 commits intopython:masterfrom
cptpcrd:set-inheritable
Jan 20, 2021
Merged

bpo-42780: fix set_inheritable() for O_PATH file descriptors on Linux#24172
vstinner merged 3 commits intopython:masterfrom
cptpcrd:set-inheritable

Conversation

@cptpcrd
Copy link
Contributor

@cptpcrd cptpcrd commented Jan 8, 2021

ioctl() doesn't work on O_PATH file descriptors on Linux, which breaks os.set_inheritable() since it uses ioctl(FIOCLEX)/ioctl(FIONCLEX) on Linux. This patch fixes that.

https://bugs.python.org/issue42780

@miss-islington
Copy link
Contributor

Thanks @cptpcrd for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 20, 2021
…pythonGH-24172)

(cherry picked from commit 7dc71c4)

Co-authored-by: cptpcrd <31829097+cptpcrd@users.noreply.github.com>
@bedevere-bot
Copy link

GH-24269 is a backport of this pull request to the 3.9 branch.

@miss-islington
Copy link
Contributor

Thanks @cptpcrd for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 20, 2021
…pythonGH-24172)

(cherry picked from commit 7dc71c4)

Co-authored-by: cptpcrd <31829097+cptpcrd@users.noreply.github.com>
@bedevere-bot
Copy link

GH-24270 is a backport of this pull request to the 3.8 branch.

@vstinner
Copy link
Member

@cptpcrd: Oh, the automated backport failed: test.support.os_helper doesn't exist in Python 3.8 and 3.9. Can you please try to backport the change? Use git cherry-pick -x 7dc71c425cf6aa6a4070a418dce5d95ca435c79f. You just have to remove ".os_helper" in the test.

cptpcrd added a commit to cptpcrd/cpython that referenced this pull request Jan 20, 2021
cptpcrd added a commit to cptpcrd/cpython that referenced this pull request Jan 20, 2021
@cptpcrd
Copy link
Contributor Author

cptpcrd commented Jan 20, 2021

@cptpcrd: Oh, the automated backport failed: test.support.os_helper doesn't exist in Python 3.8 and 3.9. Can you please try to backport the change? Use git cherry-pick -x 7dc71c425cf6aa6a4070a418dce5d95ca435c79f. You just have to remove ".os_helper" in the test.

It seems that function was available under support.make_bad_fd() (no os_helper). I've cherry-picked the commit (with the fix) into set-inheritable-3.8 and set-inheritable-3.9 on my fork. Should I PR these to 3.8 and 3.9 (respectively)?

@vstinner
Copy link
Member

Yes, please create one PR per branch.

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 this pull request may close these issues.

5 participants