X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d6cccb3ea4e5f076a436d9935e3835d4b620b859..81693ee04f18e68558c9206705ef589cca2460b0:/sdk/cwl/arvados_cwl/pathmapper.py?ds=inline diff --git a/sdk/cwl/arvados_cwl/pathmapper.py b/sdk/cwl/arvados_cwl/pathmapper.py index 7353d7239c..e0445febdc 100644 --- a/sdk/cwl/arvados_cwl/pathmapper.py +++ b/sdk/cwl/arvados_cwl/pathmapper.py @@ -1,10 +1,12 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + from future import standard_library standard_library.install_aliases() from builtins import str from past.builtins import basestring -# Copyright (C) The Arvados Authors. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 +from future.utils import viewitems import re import logging @@ -118,7 +120,7 @@ class ArvPathMapper(PathMapper): remap.append((obj["location"], path + "/" + obj["basename"])) elif obj["location"].startswith("_:") and "contents" in obj: with c.open(path + "/" + obj["basename"], "w") as f: - f.write(obj["contents"].encode("utf-8")) + f.write(obj["contents"]) remap.append((obj["location"], path + "/" + obj["basename"])) else: raise SourceLine(obj, "location", WorkflowException).makeError("Don't know what to do with '%s'" % obj["location"]) @@ -305,7 +307,7 @@ class VwdPathMapper(StagingPathMapper): # with any secondary files. self.visitlisting(referenced_files, self.stagedir, basedir) - for path, (ab, tgt, type, staged) in list(self._pathmap.items()): + for path, (ab, tgt, type, staged) in viewitems(self._pathmap): if type in ("File", "Directory") and ab.startswith("keep:"): self._pathmap[path] = MapperEnt("$(task.keep)/%s" % ab[5:], tgt, type, staged)