Author: kmtracey
Date: 2011-12-25 10:53:29 -0800 (Sun, 25 Dec 2011)
New Revision: 17275

Modified:
   django/trunk/tests/runtests.py
Log:
Fixed deletion of the runtests temp tree to work on Windows even when the tree 
contains non-ASCII filenames.


Modified: django/trunk/tests/runtests.py
===================================================================
--- django/trunk/tests/runtests.py      2011-12-25 13:24:39 UTC (rev 17274)
+++ django/trunk/tests/runtests.py      2011-12-25 18:53:29 UTC (rev 17275)
@@ -130,8 +130,11 @@
 
 def teardown(state):
     from django.conf import settings
-    # Removing the temporary TEMP_DIR
-    shutil.rmtree(TEMP_DIR)
+    # Removing the temporary TEMP_DIR. Ensure we pass in unicode
+    # so that it will successfully remove temp trees containing
+    # non-ASCII filenames on Windows. (We're assuming the temp dir
+    # name itself does not contain non-ASCII characters.)
+    shutil.rmtree(unicode(TEMP_DIR))
     # Restore the old settings.
     for key, value in state.items():
         setattr(settings, key, value)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to