summaryrefslogtreecommitdiff
path: root/fs/opener.py
diff options
context:
space:
mode:
authorwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-12-20 01:47:57 +0000
committerwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-12-20 01:47:57 +0000
commitf0eb2602db6392b1faa8b9882ab195058e6c6556 (patch)
tree10b72c7a47dd786c28296a71839eaf6a799086ee /fs/opener.py
parentbd666c828004ad1380ecbfbbc246aaf106248a7e (diff)
downloadpyfilesystem-f0eb2602db6392b1faa8b9882ab195058e6c6556.tar.gz
test fixes for windoze
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@565 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/opener.py')
-rw-r--r--fs/opener.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/opener.py b/fs/opener.py
index 63917ea..64282d3 100644
--- a/fs/opener.py
+++ b/fs/opener.py
@@ -10,7 +10,7 @@ __all__ = ['OpenerError',
import sys
from fs.osfs import OSFS
-from fs.path import pathsplit, basename, join, iswildcard
+from fs.path import pathsplit, basename, join, iswildcard, normpath
import os
import os.path
import re
@@ -24,15 +24,17 @@ class NoOpenerError(OpenerError):
def _expand_syspath(path):
if path is None:
- return path
- path = os.path.expanduser(os.path.expandvars(path))
- path = os.path.normpath(os.path.abspath(path))
- if sys.platform == "win32":
- if not path.startswith("\\\\?\\"):
- path = u"\\\\?\\" + root_path
- # If it points at the root of a drive, it needs a trailing slash.
- if len(path) == 6:
- path = path + "\\"
+ return path
+ path = os.path.expanduser(os.path.expandvars(path))
+ path = normpath(path)
+ #path = os.path.normpath(os.path.abspath(path))
+
+ #if sys.platform == "win32":
+ # if not path.startswith("\\\\?\\"):
+ # path = u"\\\\?\\" + path
+ # # If it points at the root of a drive, it needs a trailing slash.
+ # if len(path) == 6:
+ # path = path + "\\"
return path
@@ -279,7 +281,7 @@ class OSFSOpener(Opener):
def get_fs(cls, registry, fs_name, fs_name_params, fs_path, writeable, create_dir):
from fs.osfs import OSFS
- path = _expand_syspath(fs_path)
+ path = normpath(fs_path)
if create_dir and not os.path.exists(path):
from fs.osfs import _os_makedirs
_os_makedirs(path)