﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8998	stdin closed by become_daemon()	unix.gurus@…	nobody	"In ./django/utils/daemonize.py the posix become_daemon() function contains this code:
        si = open('/dev/null', 'r')
        so = open(out_log, 'a+', 0)
        se = open(err_log, 'a+', 0)
        os.dup2(si.fileno(), sys.stdin.fileno())
        os.dup2(so.fileno(), sys.stdout.fileno())
        os.dup2(se.fileno(), sys.stderr.fileno())
        # Set custom file descriptors so that they get proper buffering.
        sys.stdout, sys.stderr = so, se

When si passes out of scope the desctructor ends up closing FD 0 (sys.stdin).  If anything tries to read stdin it will get the contents of the next open()ed file.

sys.stdin = si should be sufficient to keep it in scope."		closed	Uncategorized	1.0		invalid		unix.gurus@…	Unreviewed	0	0	0	0	0	0
