summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2008-04-19 23:28:05 +0000
committerPauli Virtanen <pav@iki.fi>2008-04-19 23:28:05 +0000
commitb4be3779d4f5d71863affebc3cd601520cc5c907 (patch)
treeadcf70ad6b427e5eb9cff6c28337c3584c06696f /numpy/lib
parent3888ac43981790e5bedf4b4c040e7373f724652f (diff)
downloadnumpy-b4be3779d4f5d71863affebc3cd601520cc5c907.tar.gz
Fixing #738: Even more careful drive letter handling. And make the tests actually pass on Windows.
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/_datasource.py2
-rw-r--r--numpy/lib/tests/test__datasource.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py
index 8918925ab..20a6cc391 100644
--- a/numpy/lib/_datasource.py
+++ b/numpy/lib/_datasource.py
@@ -297,12 +297,12 @@ class DataSource (object):
"""
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):
diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py
index 708351403..ad3635490 100644
--- a/numpy/lib/tests/test__datasource.py
+++ b/numpy/lib/tests/test__datasource.py
@@ -159,7 +159,7 @@ class TestDataSourceExists(NumpyTestCase):
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 TestDataSourceAbspath(NumpyTestCase):
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):