STINNER Victor <victor.stin...@gmail.com> added the comment: >> + f = open(self.procfile, 'r') >> >> 'rb' mode is enough here, no need of Unicode ;-) > > Why?
The parent process doesn't read the file content, only the child. The parent only needs a file descriptor. >> + self.mem_watchdog = subprocess.Popen(..., stdin=f) >> >> Can't you open the /proc/pid/stat file in the child process? It might be an >> issue with SELinux or Grsecurity, but I don't expect that our buildbot use >> such security patch. > > (...) I don't want it to read another > process' /proc/<PID>/statm (I know this would require an immediate > recycling of the PID which is thus really unlikely, but hey). Oh ok, this is a good reason. You may document such tricky justifications. >> You should catch OSError here. > > Why? If we get an OSError, we can't do much except exiting anyway. To not print a traceback if the parent dies. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14154> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com