New submission from Antoine Pitrou:

The forkserver intermediate process is an implementation detail.  However, if 
you Ctrl-C the main process, the forkserver process will exit with a 
KeyboardInterrupt traceback, even if the main process catches KeyboardInterrupt 
to exit silently.  This produces stderr such as:

$ ./python forkserversignal.py 
^CTraceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/antoine/cpython/default/Lib/multiprocessing/forkserver.py", line 
164, in main
    rfds = [key.fileobj for (key, events) in selector.select()]
  File "/home/antoine/cpython/default/Lib/selectors.py", line 445, in select
    fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt


For the sake of usability, forkserver should probably silence those tracebacks 
by default, for example by changing the default signal handler in the 
forkserver process (but children forked by the forkserver process should 
probably get the default Python signal handlers...).

Not sure this can be considered a bugfix or an enhancement.

----------
components: Library (Lib)
messages: 292420
nosy: davin, pitrou, rhettinger, sbt
priority: normal
severity: normal
stage: needs patch
status: open
title: forkserver process should silence KeyboardInterrupt
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30185>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to