[Oval-commits] r54 - in trunk/tools: . oval/parser

Pavel Vinogradov blaze-guest at alioth.debian.org
Sun Jun 17 13:15:45 UTC 2007


Author: blaze-guest
Date: 2007-06-17 13:15:45 +0000 (Sun, 17 Jun 2007)
New Revision: 54

Modified:
   trunk/tools/oval/parser/wml.py
   trunk/tools/parse-dsa-oval.py
Log:
Fix locale issues (work for me, need rewrite)

Modified: trunk/tools/oval/parser/wml.py
===================================================================
--- trunk/tools/oval/parser/wml.py	2007-06-16 19:11:02 UTC (rev 53)
+++ trunk/tools/oval/parser/wml.py	2007-06-17 13:15:45 UTC (rev 54)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
 import re
 import os
 import sys
@@ -29,7 +31,10 @@
 		wmlFile = open(path)
 		
 		for line in wmlFile:
-			line = line.decode(locale.getpreferredencoding())
+			try:
+				line = line.decode(locale.getpreferredencoding())
+			except:
+				line = line.decode("koi8-r")
 				
 			descrpatern = re.compile (r'description>(.*?)</define-tag>')
 			result = descrpatern.search (line)

Modified: trunk/tools/parse-dsa-oval.py
===================================================================
--- trunk/tools/parse-dsa-oval.py	2007-06-16 19:11:02 UTC (rev 53)
+++ trunk/tools/parse-dsa-oval.py	2007-06-17 13:15:45 UTC (rev 54)
@@ -6,7 +6,7 @@
 # (c) 2007 Pavel Vinogradov
 # (c) 2004 Javier Fernandez-Sanguino                                                                                                           
 # Licensed under the GNU General Public License version 2.                                                                                     
-                                                                                                                                               
+# -*- coding: utf-8 -*-                                                                                                                                               
 import os
 import sys
 import locale




More information about the Oval-commits mailing list