# HG changeset patch
# User Olivier Delalleau <delallea@iro>
# Date 1313523855 14400
# Node ID b1af99fd7bf667878b496a8e2f22545bf16868dd
# Parent  e7c4d031d333b4d89b3aeddfef80de68410371be# Parent  8be8cdde97ee4199ae119ec8bfa2f984ccfbf0b8
Merged

diff -r 8be8cdde97ee -r b1af99fd7bf6 pylearn/datasets/config.py
--- a/pylearn/datasets/config.py	Wed Jul 27 13:27:00 2011 -0400
+++ b/pylearn/datasets/config.py	Tue Aug 16 15:44:15 2011 -0400
@@ -41,14 +41,16 @@
     if roots is None:
         roots = [data_root()]
     else:
-        roots = roots.split(':')
-    roots2 = []
-    #remove directory that don't exist
-    for root in roots:
-        if os.path.exists(root):
-            roots2.append(root)
-    data_roots.rval = roots2
-    return roots2
+        # Note that under Windows, we cannot use ':' as a delimiter because
+        # paths may contain this character. Thus we use ';' instead (similar to
+        # the PATH environment variable in Windows).
+        if sys.platform == 'win32':
+            roots = roots.split(';')
+        else:
+            roots = roots.split(':')
+    # Remove paths that are not directories.
+    data_roots.rval = [r for r in roots if os.path.isdir(r)]
+    return data_roots.rval
 
 
 def get_filepath_in_roots(*names):