[Python-Dev] Integrate the faulthandler module into Python 3.3?
Antoine Pitrou
solipsis at pitrou.net
Fri Mar 4 13:54:25 CET 2011
More information about the Python-Dev mailing list
Fri Mar 4 13:54:25 CET 2011
- Previous message: [Python-Dev] Integrate the faulthandler module into Python 3.3?
- Next message: [Python-Dev] Integrate the faulthandler module into Python 3.3?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: [Python-Dev] Integrate the faulthandler module into Python 3.3?
- Next message: [Python-Dev] Integrate the faulthandler module into Python 3.3?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list