Fix py2 bug resulting in infinite file writing.
Fix py2 bug resulting in infinite file writing.

common-workflow-language/cwltool,common-workflow-language/cwltool,dleehr/cwltool,dleehr/cwltool,dleehr/cwltool,common-workflow-language/cwltool,dleehr/cwltool