[issue18623] Factor out the _SuppressCoreFiles context manager

Antoine Pitrou report at bugs.python.org
Tue Aug 27 20:44:12 CEST 2013


Antoine Pitrou added the comment:

> As for the status code, it looks like a bash bug:

Your script gives different results here (on Ubuntu):

$ ulimit -c
0
$ ./python dumpcore.py 
6: False
$ ulimit -c unlimited
$ ./python dumpcore.py 
6: False

That's because Ubuntu overrides the core file pattern:

$ cat /proc/sys/kernel/core_pattern 
|/usr/share/apport/apport %p %s %c

If I ask for a regular core file, the script works:

$ sudo sh -c "echo core.%p > /proc/sys/kernel/core_pattern"
$ ./python dumpcore.py 
134: True

Which means the test really threatens to be unreliable (other systems may install similar mechanisms by default).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18623>
_______________________________________


More information about the Python-bugs-list mailing list