From f1b9a38366f017ec54187f42e2b041cf671c9524 Mon Sep 17 00:00:00 2001
From: davidh-ssec <david.hoese@ssec.wisc.edu>
Date: Thu, 7 Sep 2017 14:41:21 -0500
Subject: [PATCH] Fix ingest reading in bytes in python 3

---
 aossceilo/ingest.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/aossceilo/ingest.py b/aossceilo/ingest.py
index a1c15e9..2ce8a82 100755
--- a/aossceilo/ingest.py
+++ b/aossceilo/ingest.py
@@ -98,11 +98,11 @@ def init_ceilo(portdev):
                         "CLOSE\r\n")
     for line in init_commands:
         LOG.log(9, "SEND: %s", line.strip())
-        port.write(line)
+        port.write(line.encode('ascii'))
         port.flush()
         lines = port.readlines()
         for l in lines:
-            LOG.log(9, "RECV: %s", l.strip())
+            LOG.log(9, "RECV: %s", l.decode().strip())
     
     port.close()
     
@@ -188,7 +188,7 @@ def main():
         LOG.log(9, "got log %s", fptr.name)
 
         try:
-            in_lines = port.readlines()
+            in_lines = [x.decode() for x in port.readlines()]
             LOG.debug("read %s lines", len(in_lines))
             
             num_hdrs, out_lines = process_lines(in_lines, datetime.now())
-- 
GitLab