[Python-checkins] CVS: python/dist/src/Lib/test test_largefile.py,1.11,1.12

Martin v. L?wis loewis@users.sourceforge.net
Tue, 11 Dec 2001 09:57:28 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv18814

Modified Files:
	test_largefile.py 
Log Message:
Ignore SIGXFSZ. Fixes #490453.


Index: test_largefile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_largefile.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** test_largefile.py	2001/09/10 15:03:48	1.11
--- test_largefile.py	2001/12/11 17:57:26	1.12
***************
*** 9,12 ****
--- 9,21 ----
  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)