From 479f10265bbd296a7df93afaa090bca3ad737de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20Dalg=C4=B1=C3=A7?= Date: Wed, 9 Dec 2009 12:25:29 +0000 Subject: [PATCH] Raise meaningful warning when translations.xml has invalid XML. BUG:FIXED:8969 --- ChangeLog | 4 ++++ pisi/specfile.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ddb5cfd0..f6c2e9ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-12-09 Serdar Dalgıç + * pisi/specfile.py: Raise meaningful warning when translations.xml has + invalid XML, closes bug #8969 + 2009-12-08 Bahadır Kandemir * pisi/atomicoperations.py: Add package name to needs{Restart,Reboot} list if an update requires one of these actions. diff --git a/pisi/specfile.py b/pisi/specfile.py index 94a4315f..edad05b9 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -318,7 +318,10 @@ class SpecFile(xmlfile.XmlFile): def read_translations(self, path): if not os.path.exists(path): return - doc = piksemel.parse(path) + try: + doc = piksemel.parse(path) + except Exception, e: + raise Error(_("File '%s' has invalid XML") % (path) ) self._set_i18n(doc.getTag("Source"), self.source) for pak in doc.tags("Package"):