On Fri, 04 Mar 2011 13:40:16 +0100 Victor Stinner <victor.stinner at haypocalc.com> wrote: > > I am still bothered by the fact that, > > > > >>> import faulthandler > > >>> faulthandler.enable() > > >>> import sys > > >>> sys.stderr.close() > > >>> sys.stderr = open('logs/error.log', 'wb') > > >>> faulthandler.sigsegv() > > > > , does the wrong thing. > > faulthandler.enable() uses sys.stderr by default: it keeps a reference > on this object and stores its descriptor (should be 2). If you close the > file descriptor (eg. sys.stderr.close()) sys.stderr.close() doesn't close the file descriptor under Python 3: >>> import sys, os >>> sys.stderr.close() >>> os.write(2, b"foo\n") foo 4 Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4