Commit e9042dcd by willmcgugan

Made opener return an OSFS rather thatn an SubFS, where appropriate

parent 17c597e3
......@@ -67,6 +67,7 @@ __all__ = ['OpenerError',
'HTTPOpener']
from fs.path import pathsplit, join, iswildcard, normpath
from fs.osfs import OSFS
from fs.filelike import FileWrapper
from os import getcwd
import os.path
......@@ -290,8 +291,11 @@ class OpenerRegistry(object):
"""
fs, path = self.parse(fs_url, writeable=writeable, create_dir=create_dir)
if path and '://' not in fs_url:
# A shortcut to return an OSFS rather than a SubFS for os paths
return OSFS(fs_url)
if path:
return fs.opendir(path)
fs = fs.opendir(path)
return fs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment