File fix-tests.patch of Package python-intake
Index: intake-0.7.0/intake/source/base.py
===================================================================
--- intake-0.7.0.orig/intake/source/base.py
+++ intake-0.7.0/intake/source/base.py
@@ -485,7 +485,8 @@ class PatternMixin(object):
@urlpath.setter
def urlpath(self, urlpath):
- from .utils import path_to_glob
+ from .utils import path_to_glob, fix_paths
+ urlpath = fix_paths(urlpath)
if hasattr(self, "_original_urlpath"):
self._urlpath = urlpath
Index: intake-0.7.0/intake/source/textfiles.py
===================================================================
--- intake-0.7.0.orig/intake/source/textfiles.py
+++ intake-0.7.0/intake/source/textfiles.py
@@ -55,6 +55,10 @@ class TextFilesSource(base.DataSource):
encoding arguments, and parameters specific to the remote
file-system driver, if using.
"""
+
+ from .utils import fix_paths
+ urlpath = fix_paths(urlpath)
+
self._urlpath = urlpath
self._storage_options = storage_options or {}
self._dataframe = None
Index: intake-0.7.0/intake/source/utils.py
===================================================================
--- intake-0.7.0.orig/intake/source/utils.py
+++ intake-0.7.0/intake/source/utils.py
@@ -4,6 +4,7 @@
#
# The full license is in the LICENSE file, distributed with this software.
# -----------------------------------------------------------------------------
+import re
from hashlib import md5
from ..utils import make_path_posix
@@ -263,6 +264,15 @@ def path_to_glob(path):
return glob
+def fix_paths(urlpath):
+ if isinstance(urlpath, list):
+ urlpath = [re.sub(r'([^/])//([^/])', r'\1/\2', i) for i in urlpath]
+ elif isinstance(urlpath, str):
+ urlpath = re.sub(r'([^/])//([^/])', r'\1/\2', urlpath)
+
+ return urlpath
+
+
def path_to_pattern(path, metadata=None):
"""
Remove source information from path when using chaching
Index: intake-0.7.0/intake/interface/base.py
===================================================================
--- intake-0.7.0.orig/intake/interface/base.py
+++ intake-0.7.0/intake/interface/base.py
@@ -202,7 +202,7 @@ class BaseSelector(Base):
"""
options = self._create_options(new)
if self.widget.value:
- self.widget.set_param(options=options, value=list(options.values())[:1])
+ self.widget.param.update(options=options, value=list(options.values())[:1])
else:
self.widget.options = options
self.widget.value = list(options.values())[:1]