[issue18623] Factor out the _SuppressCoreFiles context manager

2013-09-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Is there anything else that this patch should address? I hoped Charles-François would answer this one, but no, I don't think there's anything left :) Next step (for another issue perhaps) is to actually re-use this context manager in the other tests which de

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-09-06 Thread Charles-François Natali
Charles-François Natali added the comment: >> Is there anything else that this patch should address? > > I hoped Charles-François would answer this one, but no, I don't think there's > anything left :) Sorry, I had completely forgotten this issue. The only comment I have is this: class Suppre

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-09-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed, thanks! -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-09-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The explicit 'object' superclass is old-school ;-) Ha. Ok, I've fixed it. -- ___ Python tracker ___ _

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 28a1843c0fc1 by Antoine Pitrou in branch 'default': Issue #18623: Factor out the _SuppressCoreFiles context manager into test.support. http://hg.python.org/cpython/rev/28a1843c0fc1 -- nosy: +python-dev _

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-31 Thread Valerie Lambert
Valerie Lambert added the comment: Running through both your scripts on my machine (using Ubuntu) WCOREDUMP is always True (though I'll only be able to find a core file when ulimit is set to unlimited, as expected). Because there doesn't seem to be a good way to test this, I've cut the test f

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-27 Thread Antoine Pitrou
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 patter

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-27 Thread Charles-François Natali
Charles-François Natali added the comment: The test works for me. The only problem is that faulthandler dumps a stack: it might be better to use subprocess with stderr=devnull). As for the status code, it looks like a bash bug: """ $ cat /tmp/test_core.py import os if os.fork() == 0: os.abo

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If its a problem with the test I'm guessing it might have to do with how > os.WCOREDUMP() decides whether a process has dumped its core or not. You are right, the status code doesn't seem affected by whether the core file was actually dumped or not: $ ulimi

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-26 Thread Valerie Lambert
Valerie Lambert added the comment: I've added a new test that uses fork() and os.abort(), then asserts os.WCOREDUMP() is false. However, this test is currently failing. Is my test incorrect, or is this an issue with SuppressCoreFiles() itself? If its a problem with the test I'm guessing it mi

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-23 Thread Valerie Lambert
Valerie Lambert added the comment: Of course, here is the patch without the '--git' option. -- Added file: http://bugs.python.org/file31442/issue-18623_v2.patch ___ Python tracker __

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Will also be useful for issue #18808 :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: Could you post your patch without the '--git' option? Apparently it doesn't work well with the code review tool. > It would be nice if there was a more explicit way to test the > creation of core files, however. One possibility would be to fork() a chi

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-22 Thread Valerie Lambert
Valerie Lambert added the comment: I have included a patch that moves _SuppressCoreFiles into test.support and a test that checks whether resource.RLIMIT_CORE is being properly set and reset. It would be nice if there was a more explicit way to test the creation of core files, however. The pat

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, and the recursion limit tests in test_sys dump core too... -- ___ Python tracker ___ ___ Python-

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-01 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-01 Thread Antoine Pitrou
New submission from Antoine Pitrou: _SuppressCoreFiles in test_subprocess is a useful facility for other tests, for instance test_faulthandler (which has its own logic) or test_capi (which actually happily dumps core in one of its subtests). It could probably be factored out into test.support.