Author vstinner
Recipients Jurko.Gospodnetić, brian.curtin, lemburg, pitrou, tim.golden, tim.peters, vstinner
Date 2013-12-19.16:14:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387469693.37.0.41362390211.issue19983@psf.upfronthosting.co.za>
In-reply-to
Content
init_error.patch: modify Py_Initialize() to exit with exit(1) instead of abort(), to not call the sytem fault handler (ex: dump a coredump on Linux, or open a popup on Windows).

The patch calls also initsigs() before initfsencoding(), because initfsencoding() may call Python code (encodings implemented in Python).

Example with gdb (to simulate a CTRL+c during Python startup):

$ gdb ./python
(gdb) b initfsencoding 
(gdb) run
Breakpoint 1, initfsencoding (interp=0x971420) at Python/pythonrun.c:972
(gdb) signal SIGINT
(gdb) cont
Python initialization error: Unable to get the locale encoding
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 2152, in _find_and_load
KeyboardInterrupt
[Inferior 1 (process 15566) exited with code 01]

The process exited with exit code 1, not with SIGABRT.
History
Date User Action Args
2013-12-19 16:14:53vstinnersetrecipients: + vstinner, lemburg, tim.peters, pitrou, tim.golden, brian.curtin, Jurko.Gospodnetić
2013-12-19 16:14:53vstinnersetmessageid: <1387469693.37.0.41362390211.issue19983@psf.upfronthosting.co.za>
2013-12-19 16:14:53vstinnerlinkissue19983 messages
2013-12-19 16:14:52vstinnercreate