Guido van Rossum added the comment:

> The minimal code reporting the -33/+33 leaks that I found is simply this:
>
>    os.popen('ls').read()
>
> Is there a problem in "os.popen(...)", or do I something wrong here?

Try this instead:

 p = os.popen('ls')
 try:
   x = p.read()
 finally:
   p.close()

IOW close the pipe explicitly. That should make the code execute in a
more reproducible fashion. I've fixed this in ctypes/util.py now:
r59477.

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1597>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to