This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients nadeem.vawda, neologix, pitrou, vstinner
Date 2012-02-29.09:08:35
SpamBayes Score 5.7309375e-09
Marked as misclassified No
Message-id <CAMpsgwa1mRf3rk-2rtNWkvp28+LH8S+QZ8Q12R6r8EzJB0bTxw@mail.gmail.com>
In-reply-to <CAH_1eM3QjUpxpdUFjYNyVov75BmO4x6yugahOM9JtCoiYoVawQ@mail.gmail.com>
Content
>> + 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.
History
Date User Action Args
2012-02-29 09:08:36vstinnersetrecipients: + vstinner, pitrou, nadeem.vawda, neologix
2012-02-29 09:08:35vstinnerlinkissue14154 messages
2012-02-29 09:08:35vstinnercreate