Skip to content

Instantly share code, notes, and snippets.

View estyrke's full-sized avatar

Emil Styrke estyrke

  • Arboair AB
  • Sweden
  • 12:47 (UTC +02:00)
  • X @estyrke
View GitHub Profile
@estyrke
estyrke / Readme.md
Last active August 29, 2015 14:18 — forked from anonymous/child.c

Tests for file handle inheritance issues

  1. test_write.py uses subprocess.call without redirection
  • This fails on Python 2.x because the close_fds argument to call() defaults to False and file handles are inheritable by default
  • This succeeds on Python 3.x because the close_fds argument to call() defaults to True when redirection is not used
  1. test_write_redirect.py uses subprocess.call with stdout redirection
  • This fails on Python 2.x because the close_fds argument to call() defaults to False and file handles are inheritable by default
  • This fails on Python 3.x (x < 4) because the close_fds argument to call() defaults to False when redirection is used and file handles are inheritable by default
  • This succeeds on Python 3.4 because file handles are non-inheritable by default