New submission from Giampaolo Rodola' <g.rod...@gmail.com>: /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). ---------- messages: 145936 nosy: giampaolo.rodola, pitrou priority: normal severity: normal status: open title: Erroneous unclosed file warning versions: Python 3.2, Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13222> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com