Commit e9042dcd by willmcgugan

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

parent 17c597e3
...@@ -67,6 +67,7 @@ __all__ = ['OpenerError', ...@@ -67,6 +67,7 @@ __all__ = ['OpenerError',
'HTTPOpener'] 'HTTPOpener']
from fs.path import pathsplit, join, iswildcard, normpath from fs.path import pathsplit, join, iswildcard, normpath
from fs.osfs import OSFS
from fs.filelike import FileWrapper from fs.filelike import FileWrapper
from os import getcwd from os import getcwd
import os.path import os.path
...@@ -290,8 +291,11 @@ class OpenerRegistry(object): ...@@ -290,8 +291,11 @@ class OpenerRegistry(object):
""" """
fs, path = self.parse(fs_url, writeable=writeable, create_dir=create_dir) 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: if path:
return fs.opendir(path) fs = fs.opendir(path)
return fs 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