[Skip Montanaro] > Yeah, but they probably all represent some sort of bug. There's nothing fishy about having many references to a single file object. >>> import sys >>> sys.getrefcount(sys.stdout) 5 >>> > How about a warning which is disabled by default but which the > programmer can enable? It's not addressing the right problem, and wouldn't stop the segfaults anyway.