From b2cc634e8a2eea74adf96ee7a4ee6c29d37b00f3 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Mon, 20 Nov 2017 22:34:02 +0100 Subject: [PATCH] python3 fix (#5043) strings can not be written to byte mode file handlers. writing resulted in: TypeError: a bytes-like object is required, not 'str' Alternative would be to make string byte. --- tools/stats/gsummary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/stats/gsummary.py b/tools/stats/gsummary.py index 44ea737d672..276a30f9349 100755 --- a/tools/stats/gsummary.py +++ b/tools/stats/gsummary.py @@ -59,7 +59,7 @@ def main(): except Exception: pass - tmp_file = tempfile.NamedTemporaryFile('w+b') + tmp_file = tempfile.NamedTemporaryFile('w+') # Write the R header row to the temporary file hdr_str = "\t".join("c%s" % str(col + 1) for col in cols) tmp_file.write("%s\n" % hdr_str)