On Sat, Oct 30, 2010 at 3:06 PM, Glyph Lefkowitz <gl...@twistedmatrix.com> wrote: > > On Oct 30, 2010, at 2:39 PM, Jack Diederich wrote: > > On Fri, Oct 29, 2010 at 8:35 PM, Brett Cannon <br...@python.org> wrote: > > For those of you who have not noticed, Antoine committed a patch that > > raises a ResourceWarning under a pydebug build if a file or socket is > > closed through garbage collection instead of being explicitly closed. > > Just yesterday I discovered /proc/<your PID here>/fd/ which is a list > of open file descriptors for your PID on *nix and includes all open > files, pipes, and sockets. Very handy, I filed some tickets about > company internal libs that were opening file handles as a side effect > of import (logging mostly). I tried to provoke standard python > imports (non-test) to leave some open handles and came up empty. > > That path (and anything below /proc, really) is a list of open file > descriptors specifically on Linux, not "*nix". Also on linux, you can avoid > "<your pid here>" by just doing "/proc/self".
I was happy to find out that the /proc system came from Plan9 because I always thought Plan9 was dead water. But in this particular case Plan9 outdid System7 in the the realm of "everything is a file" by making everything a file. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com