Skip to content

bpo-32849: Fix is_valid_fd() on FreeBSD#12852

Merged
vstinner merged 1 commit intopython:masterfrom
vstinner:is_valid_fd_bsd
Apr 17, 2019
Merged

bpo-32849: Fix is_valid_fd() on FreeBSD#12852
vstinner merged 1 commit intopython:masterfrom
vstinner:is_valid_fd_bsd

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented Apr 16, 2019

Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.

On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.

https://bugs.python.org/issue32849

@vstinner
Copy link
Copy Markdown
Member Author

See also PR #5773.

Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.

On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.
@vstinner
Copy link
Copy Markdown
Member Author

@izbyshev: Would you mind to review my change?

@vstinner vstinner merged commit 3092d6b into python:master Apr 17, 2019
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@vstinner vstinner deleted the is_valid_fd_bsd branch April 17, 2019 16:09
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 17, 2019
Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.

On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.
(cherry picked from commit 3092d6b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
@bedevere-bot
Copy link
Copy Markdown

GH-12863 is a backport of this pull request to the 3.7 branch.

vstinner added a commit that referenced this pull request Apr 17, 2019
Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.

On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.
(cherry picked from commit 3092d6b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
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.

4 participants