[ARVADOS] created: 1.3.0-1239-g927d62b54
Git user
git at public.curoverse.com
Wed Jul 3 18:06:27 UTC 2019
at 927d62b545e90676bf4729b6c1ebee56d51eacbe (commit)
commit 927d62b545e90676bf4729b6c1ebee56d51eacbe
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Wed Jul 3 14:03:33 2019 -0400
15358: Add encoding option to CollectionFsAccess.open() and use in fetch_text()
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/sdk/cwl/arvados_cwl/fsaccess.py b/sdk/cwl/arvados_cwl/fsaccess.py
index 252ca57d4..c1ea586b0 100644
--- a/sdk/cwl/arvados_cwl/fsaccess.py
+++ b/sdk/cwl/arvados_cwl/fsaccess.py
@@ -133,10 +133,10 @@ class CollectionFsAccess(cwltool.stdfsaccess.StdFsAccess):
patternsegments = rest.split("/")
return sorted(self._match(collection, patternsegments, "keep:" + collection.manifest_locator()))
- def open(self, fn, mode):
+ def open(self, fn, mode, encoding=None):
collection, rest = self.get_collection(fn)
if collection is not None:
- return collection.open(rest, mode)
+ return collection.open(rest, mode, encoding=encoding)
else:
return super(CollectionFsAccess, self).open(self._abs(fn), mode)
@@ -225,7 +225,7 @@ class CollectionFetcher(DefaultFetcher):
def fetch_text(self, url):
if url.startswith("keep:"):
- with self.fsaccess.open(url, "r") as f:
+ with self.fsaccess.open(url, "r", encoding="utf-8") as f:
return f.read()
if url.startswith("arvwf:"):
record = self.api_client.workflows().get(uuid=url[6:]).execute(num_retries=self.num_retries)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list