]> granicus.if.org Git - python/commitdiff
Ignore SIGXFSZ. Fixes #490453.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 11 Dec 2001 17:57:26 +0000 (17:57 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 11 Dec 2001 17:57:26 +0000 (17:57 +0000)
Lib/test/test_largefile.py

index 352fae07ce2aa7d796c73f5b65047a5c7e4266bb..abfee39e988a570e6e0833486aca48ddeb9f0eda 100644 (file)
@@ -8,6 +8,15 @@
 import test_support
 import os, struct, stat, sys
 
+try:
+    import signal
+    # The default handler for SIGXFSZ is to abort the process.
+    # By ignoring it, system calls exceeding the file size resource
+    # limit will raise IOError instead of crashing the interpreter.
+    oldhandler = signal.signal(signal.SIGXFSZ, signal.SIG_IGN)
+except (ImportError, AttributeError):
+    pass
+
 
 # create >2GB file (2GB = 2147483648 bytes)
 size = 2500000000L