Skip to content

Commit 7d6c437

Browse files
committed
bytes written as-is
(should not really appear in CWL entities)
1 parent 4b806a0 commit 7d6c437

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cwltool/provenance.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,16 @@ def declare_artefact(self, value):
554554
{provM.PROV_TYPE: WFPROV["Artifact"],
555555
provM.PROV_VALUE: str(value)})
556556

557+
elif isinstance(value, bytes):
558+
# If we got here then we must be in Python 3
559+
byte_s = io.BytesIO(value)
560+
data_file = self.research_object.add_data_file(byte_s)
561+
# FIXME: Don't naively assume add_data_file uses hash in filename!
562+
data_id = "data:%s" % posixpath.split(data_file)[1]
563+
return self.document.entity(data_id,
564+
{provM.PROV_TYPE: WFPROV["Artifact"],
565+
provM.PROV_VALUE: str(value)})
566+
557567
elif isinstance(value, dict):
558568
# Base case - we found a File we need to update
559569
if value.get("class") == "File":

0 commit comments

Comments
 (0)