From 489704a5fca84f58105ee61d4365d254a4bb0c0d Mon Sep 17 00:00:00 2001 From: Florin Iucha Date: Thu, 6 Feb 2020 14:59:52 -0500 Subject: [PATCH 1/2] Make samparser executable under UNIX --- samparser.py | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 samparser.py diff --git a/samparser.py b/samparser.py old mode 100644 new mode 100755 index 0f08f17..be22666 --- a/samparser.py +++ b/samparser.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import sys from statemachine import StateMachine from lxml import etree From 5ab72d280afdd20a1d142531b9618b3a00210103 Mon Sep 17 00:00:00 2001 From: Florin Iucha Date: Thu, 6 Feb 2020 15:03:31 -0500 Subject: [PATCH 2/2] Fix bytes/str encode/decode --- samparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samparser.py b/samparser.py index be22666..067c518 100755 --- a/samparser.py +++ b/samparser.py @@ -3641,7 +3641,7 @@ def write_output(input_file, default_output_extension, source_func, mode="binary outf.write(i) else: for i in source_func(): - sys.stdout.buffer.write(i.decode("utf-8")) + sys.stdout.buffer.write(i) else: if output_file: os.makedirs(os.path.dirname(output_file), exist_ok=True) @@ -3650,7 +3650,7 @@ def write_output(input_file, default_output_extension, source_func, mode="binary outf.write(i) else: for i in source_func(): - sys.stdout.buffer.write(i) + sys.stdout.buffer.write(i.encode()) return output_file