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

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

Merged
merged 1 commit into from
Apr 17, 2019
Merged

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

merged 1 commit into from
Apr 17, 2019

Conversation

vstinner
Copy link
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
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
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
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

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