#16682: KeyboardInterrupt not handled properly in transaction aborting -------------------------------------+------------------------------------- Reporter: mtredinnick | Owner: nobody Type: Bug | Status: reopened Component: Database layer | Version: 1.3 (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: | Needs documentation: 0 Has patch: 0 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by claudep):
* status: closed => reopened * resolution: needsinfo => * stage: Unreviewed => Accepted Comment: I've been able to reproduce it with the following code (you can insert it in regressiontests/transactions_regress/tests.py): {{{ def test_rollback_on_keyboardinterrupt(self): import time try: with transaction.commit_on_success(): Mod.objects.create(fld=17624) print "Hit Ctrl-C now!" time.sleep(5) print "Too late, and I didn't bother to return a HttpResponse" except KeyboardInterrupt: pass self.assertEqual(Mod.objects.all().count(), 0) }}} Unfortunately, I didn't manage to simulate a Ctrl-C programmatically, so as to be able to include a real test. Ideas welcome. -- Ticket URL: <https://code.djangoproject.com/ticket/16682#comment:4> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.