commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/common/src GParser.py


From: Jan Ischebeck
Subject: gnue/common/src GParser.py
Date: Mon, 10 Feb 2003 05:44:09 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jan Ischebeck <address@hidden>  03/02/10 05:44:07

Modified files:
        common/src     : GParser.py 

Log message:
        catch unicode error for wrong characters in GParsers attribute parsing 
block

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GParser.py.diff?tr1=1.61&tr2=1.62&r1=text&r2=text

Patches:
Index: gnue/common/src/GParser.py
diff -c gnue/common/src/GParser.py:1.61 gnue/common/src/GParser.py:1.62
*** gnue/common/src/GParser.py:1.61     Sat Jan 25 16:41:40 2003
--- gnue/common/src/GParser.py  Mon Feb 10 05:44:07 2003
***************
*** 267,273 ****
            xmlns[prefix] = attrns
  
          else:
! 
            # Typecasting, anyone?  If attribute should be int, make it an int
            try:
              attrs[attr] = 
baseAttrs[attr].get('Typecast',GTypecast.text)(saxattrs[qattr].encode(gConfig('textEncoding')))
--- 267,273 ----
            xmlns[prefix] = attrns
  
          else:
!           
            # Typecasting, anyone?  If attribute should be int, make it an int
            try:
              attrs[attr] = 
baseAttrs[attr].get('Typecast',GTypecast.text)(saxattrs[qattr].encode(gConfig('textEncoding')))
***************
*** 276,281 ****
--- 276,287 ----
              tmsg = _('Error processing <%s> tag [I do not recognize the "%s" 
attribute')\
                  % (name, attr) 
              raise MarkupError, tmsg
+           
+           except UnicodeError:
+             tmsg = _('Error processing <%s> tag [Encoding error: invalid 
character in "%s" attribute;]')\
+                 % (name, attr) 
+             raise MarkupError, tmsg
+ 
            except:
              tmsg = _('Error processing <%s> tag [invalid type for "%s" 
attribute; value is "%s"]')\
                  % (name, attr, saxattrs[qattr]) 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]