A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-March/108627.html below:

[Python-Dev] Integrate the faulthandler module into Python 3.3?

[Python-Dev] Integrate the faulthandler module into Python 3.3? [Python-Dev] Integrate the faulthandler module into Python 3.3?Antoine Pitrou solipsis at pitrou.net
Fri Mar 4 13:54:25 CET 2011
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.


More information about the Python-Dev mailing list

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