[Numpy-svn] r5048 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Sat Apr 19 17:29:55 CDT 2008


Author: ptvirtan
Date: 2008-04-19 17:29:47 -0500 (Sat, 19 Apr 2008)
New Revision: 5048

Modified:
   trunk/numpy/lib/_datasource.py
Log:
Fixing #738: remember to sanitize away also Windows drive letters


Modified: trunk/numpy/lib/_datasource.py
===================================================================
--- trunk/numpy/lib/_datasource.py	2008-04-19 21:45:35 UTC (rev 5047)
+++ trunk/numpy/lib/_datasource.py	2008-04-19 22:29:47 UTC (rev 5048)
@@ -297,9 +297,10 @@
         """
         last = None
         path = os.path.normpath(path)
+        drive, path = os.path.splitdrive(path) # for Windows
         while path != last:
             last = path
-            # Note: os.path.join treats '/' as os.sep
+            # Note: os.path.join treats '/' as os.sep on Windows
             path = path.lstrip(os.sep).lstrip('/')
             path = path.lstrip(os.pardir).lstrip('..')
         return path



More information about the Numpy-svn mailing list