From 0888d4fa17bc7bdaf64ff894f440d84c059efb16 Mon Sep 17 00:00:00 2001
From: Auke Klazema <klazema@astron.nl>
Date: Fri, 22 Mar 2019 11:47:24 +0000
Subject: [PATCH] SW-328: StringIO doesn't like bytes anymore

---
 .../lib/lofarxml_to_momxmlmodel_translator.py                 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py b/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py
index e6168e4de2a..4786ea3e621 100644
--- a/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py
+++ b/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py
@@ -21,7 +21,7 @@
 # with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
 
 from lxml import etree
-from io import StringIO
+from io import BytesIO
 
 from lofar.specificationservices.telescope_model import TelescopeModel
 from lofar.specificationservices.specification_service import _parse_relation_tree
@@ -29,7 +29,7 @@ from lofar.specificationservices.specification_service import _parse_relation_tr
 
 class LofarXMLToMomXMLModelTranslator(object):
     def generate_model(self, lofar_spec):
-        doc = etree.parse(StringIO(lofar_spec.encode('UTF-8')))
+        doc = etree.parse(BytesIO(lofar_spec.encode('UTF-8')))
 
         project_codes = doc.xpath('/spec:specification/projectReference/ProjectCode',
                                   namespaces={"spec": "http://www.astron.nl/LofarSpecification"})
-- 
GitLab