From ca196238e324cfa6d577666596588f2d8e5bb5d0 Mon Sep 17 00:00:00 2001
From: John Mertic <jmertic@linuxfoundation.org>
Date: Wed, 4 Dec 2024 07:58:26 -0500
Subject: [PATCH] Strip out `\u2028` character, as it causes issues reading
 back the file

Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
---
 lfx_landscape_tools/landscapeoutput.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lfx_landscape_tools/landscapeoutput.py b/lfx_landscape_tools/landscapeoutput.py
index 4546634..fb5c4b8 100644
--- a/lfx_landscape_tools/landscapeoutput.py
+++ b/lfx_landscape_tools/landscapeoutput.py
@@ -49,8 +49,11 @@ def load(self, resetCategory = False, newLandscape = False):
         if not newLandscape:
             try:
                 with open(self.landscapefile, 'r', encoding="utf8", errors='ignore') as fileobject: 
+                    logging.getLogger().info("Successfully opened landscape file '{}'".format(self.landscapefile))
                     self.landscape = ruamel.yaml.YAML().load(fileobject)
-            except:
+                    logging.getLogger().info("Successfully parsed yaml output in landscape file '{}'".format(self.landscapefile))
+            except Exception as e:
+                logging.getLogger().error("Error opening landscape file '{}' - will reset file - '{}'".format(self.landscapefile,e))
                 newLandscape = True
         found = False
         if self.landscape:
@@ -208,7 +211,7 @@ def save(self):
             ryaml.dump(self.landscape, fileobject, transform=self._removeNulls)
 
     def _removeNulls(self,yamlout):
-        return yamlout.replace('- item: null','- item:').replace('- category: null','- category:').replace('- subcategory: null','- subcategory:')
+        return yamlout.replace('- item: null','- item:').replace('- category: null','- category:').replace('- subcategory: null','- subcategory:').replace('\u2028',' ')
 
     def _str_presenter(self, dumper, data):
         if '\n' in data: