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 giampaolo.rodola
Recipients giampaolo.rodola, pitrou
Date 2011-10-19.18:53:47
SpamBayes Score 0.010561358
Marked as misclassified No
Message-id <1319050428.96.0.600308451611.issue13222@psf.upfronthosting.co.za>
In-reply-to
Content
/opt/python3.2/lib/python3.2/site-packages/psutil/_pslinux.py:389: ResourceWarning: unclosed file <_io.FileIO name=7 mode='rb'>
  return [x for x in f.read().split('\x00') if x]

I get this while running tests.
The method in question is defined as such:

    @wrap_exceptions
    def get_process_cmdline(self):
        f = open("/proc/%s/cmdline" % self.pid)
        try:
            # return the args as a list
            return [x for x in f.read().split('\x00') if x]
        finally:
            f.close()

...therefore, I'm closing the file object (in the finally block).
History
Date User Action Args
2011-10-19 18:53:48giampaolo.rodolasetrecipients: + giampaolo.rodola, pitrou
2011-10-19 18:53:48giampaolo.rodolasetmessageid: <1319050428.96.0.600308451611.issue13222@psf.upfronthosting.co.za>
2011-10-19 18:53:48giampaolo.rodolalinkissue13222 messages
2011-10-19 18:53:47giampaolo.rodolacreate