[Numpy-svn] r5049 - in trunk/numpy/lib: . tests

numpy-svn@scip... numpy-svn@scip...
Sat Apr 19 18:28:13 CDT 2008


Author: ptvirtan
Date: 2008-04-19 18:28:05 -0500 (Sat, 19 Apr 2008)
New Revision: 5049

Modified:
   trunk/numpy/lib/_datasource.py
   trunk/numpy/lib/tests/test__datasource.py
Log:
Fixing #738: Even more careful drive letter handling. And make the tests actually pass on Windows.


Modified: trunk/numpy/lib/_datasource.py
===================================================================
--- trunk/numpy/lib/_datasource.py	2008-04-19 22:29:47 UTC (rev 5048)
+++ trunk/numpy/lib/_datasource.py	2008-04-19 23:28:05 UTC (rev 5049)
@@ -297,12 +297,12 @@
         """
         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 on Windows
             path = path.lstrip(os.sep).lstrip('/')
             path = path.lstrip(os.pardir).lstrip('..')
+            drive, path = os.path.splitdrive(path) # for Windows
         return path
 
     def exists(self, path):

Modified: trunk/numpy/lib/tests/test__datasource.py
===================================================================
--- trunk/numpy/lib/tests/test__datasource.py	2008-04-19 22:29:47 UTC (rev 5048)
+++ trunk/numpy/lib/tests/test__datasource.py	2008-04-19 23:28:05 UTC (rev 5049)
@@ -159,7 +159,7 @@
 
 class TestDataSourceAbspath(NumpyTestCase):
     def setUp(self):
-        self.tmpdir = mkdtemp()
+        self.tmpdir = os.path.abspath(mkdtemp())
         self.ds = datasource.DataSource(self.tmpdir)
 
     def tearDown(self):
@@ -224,7 +224,7 @@
 
 class TestRepositoryAbspath(NumpyTestCase):
     def setUp(self):
-        self.tmpdir = mkdtemp()
+        self.tmpdir = os.path.abspath(mkdtemp())
         self.repos = datasource.Repository(valid_baseurl(), self.tmpdir)
 
     def tearDown(self):



More information about the Numpy-svn mailing list