Message154605
>> + 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. |
|
Date |
User |
Action |
Args |
2012-02-29 09:08:36 | vstinner | set | recipients:
+ vstinner, pitrou, nadeem.vawda, neologix |
2012-02-29 09:08:35 | vstinner | link | issue14154 messages |
2012-02-29 09:08:35 | vstinner | create | |
|