diff options
author | Pauli Virtanen <pav@iki.fi> | 2008-04-19 22:29:47 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2008-04-19 22:29:47 +0000 |
commit | 3888ac43981790e5bedf4b4c040e7373f724652f (patch) | |
tree | 9024b3ea514fc8305dd0f5bbd9c99dd81bafc690 /numpy/lib/_datasource.py | |
parent | 5fc5deb1d60e83c9d15fb2f8d623dbef52751e3b (diff) | |
download | numpy-3888ac43981790e5bedf4b4c040e7373f724652f.tar.gz |
Fixing #738: remember to sanitize away also Windows drive letters
Diffstat (limited to 'numpy/lib/_datasource.py')
-rw-r--r-- | numpy/lib/_datasource.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py index 653432405..8918925ab 100644 --- a/numpy/lib/_datasource.py +++ b/numpy/lib/_datasource.py @@ -297,9 +297,10 @@ 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 + # Note: os.path.join treats '/' as os.sep on Windows path = path.lstrip(os.sep).lstrip('/') path = path.lstrip(os.pardir).lstrip('..') return path |