-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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-33773: Fix test.support.fd_count() on Linux/FreBSD #7421
Conversation
Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory.
Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure.
Oh... the test failed on Travis CI:
|
"import test.support" indirectly imports the random module, and this import calls os.urandom(). On old Linx kernel/glibc, Python keeps a FD open on the /dev/urandom device... I rewrote the test to only see a difference, not test the absolute value. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
GH-7454 is a backport of this pull request to the 3.6 branch. |
Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure. (cherry picked from commit 492d642) Co-authored-by: Victor Stinner <vstinner@redhat.com>
Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure. (cherry picked from commit 492d642) Co-authored-by: Victor Stinner <vstinner@redhat.com>
GH-7455 is a backport of this pull request to the 3.7 branch. |
Sorry, @vstinner, I could not cleanly backport this to |
GH-7456 is a backport of this pull request to the 2.7 branch. |
Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure. (cherry picked from commit 492d642) Co-authored-by: Victor Stinner <vstinner@redhat.com>
Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure. (cherry picked from commit 492d642) Co-authored-by: Victor Stinner <vstinner@redhat.com>
…7456) Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure. (cherry picked from commit 492d642)
Substract one because listdir() opens internally a file
descriptor to list the content of the /proc/self/fd/ directory.
https://bugs.python.org/issue33773