◐ Shell
clean mode source ↗

[2.7] bpo-18174: Fix file descriptor leaks in tests by vstinner · Pull Request #7408 · python/cpython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@vstinner

  • test_tempfile.test_no_leak_fd() mocks os.close() but it doesn't
    call the original os.close() method and so leaks an open file
    descriptor. Fix the test by calling the original os.close()
    function.
  • test_posix.test_fdopen_directory(): close the directory file
    descriptor when the test completes.

https://bugs.python.org/issue18174

* test_tempfile.test_no_leak_fd() mocks os.close() but it doesn't
  call the original os.close() method and so leaks an open file
  descriptor. Fix the test by calling the original os.close()
  function.
* test_posix.test_fdopen_directory(): close the directory file
  descriptor when the test completes.

Labels