[Python-checkins] r81175 - python/branches/release31-maint/Lib/test/support.py

victor.stinner python-checkins at python.org
Fri May 14 22:08:55 CEST 2010


Author: victor.stinner
Date: Fri May 14 22:08:55 2010
New Revision: 81175

Log:
test/support.py: remove TESTFN if it is a directory

Because of my previous commit (r81171), test_os failed without removing TESTFN
directory (shutil.rmtree() was broken). Some buildbots still have a @test
directory and some tests fail because of that.

The bug is reproductible with:

  mkdir @test
  touch @test/abc
  ./python Lib/test/regrtest.py test_site


Modified:
   python/branches/release31-maint/Lib/test/support.py

Modified: python/branches/release31-maint/Lib/test/support.py
==============================================================================
--- python/branches/release31-maint/Lib/test/support.py	(original)
+++ python/branches/release31-maint/Lib/test/support.py	Fri May 14 22:08:55 2010
@@ -365,6 +365,10 @@
                   'Unicode filename tests may not be effective'
                   % TESTFN_UNICODE_UNENCODEABLE)
 
+if os.path.isdir(TESTFN):
+    # a test failed (eg. test_os) without removing TESTFN directory
+    shutil.rmtree(TESTFN)
+
 # Make sure we can write to TESTFN, try in /tmp if we can't
 fp = None
 try:


More information about the Python-checkins mailing list