[elbe-devel] [PATCH 4/6] changelogxml: add the 'replace' flag to changelog decode() statement

Torben Hohn torben.hohn at linutronix.de
Mon Jul 8 16:27:11 CEST 2019


we can not rely on the changelog being correct in any case, and
we dont want the changelog generation to throw and/or miss a changelog.

use error='replace' and remove the Exception handling, which was only
useful for debugging.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/changelogxml.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/elbepack/changelogxml.py b/elbepack/changelogxml.py
index a0681f921..376fc241d 100644
--- a/elbepack/changelogxml.py
+++ b/elbepack/changelogxml.py
@@ -24,10 +24,7 @@ class changelogs_xml(object):
         xmlpkg.et.attrib['version'] = xp.candidate_version
         xmlpkg.et.attrib['old_version'] = xp.installed_version
 
-        try:
-            xmlpkg.et.text = changelog_text.decode('utf-8')
-        except ValueError:
-            print changelog_text
+        xmlpkg.et.text = changelog_text.decode('utf-8', 'replace')
 
     def write(self, fname):
         self.outxml.write(fname, encoding="utf-8")
-- 
2.11.0




More information about the elbe-devel mailing list