I am trying to handle a Unicode error but its acting like the except
clause is not even there. Here is the offending code:
def characters(self , string):
if self.initem:
try:
self.data.appen d(string.encode ())
except:
self.data.appen d('No habla la Unicode')
And the exception:
File "C:\Users\Adam\ Desktop\XMLWork space.py", line 65, in characters
try:
UnicodeEncodeEr ror: 'ascii' codec can't encode character u'\u2026' in
position 83: ordinal not in range(128)
Its got to be something really dumb I'm missing, this make no sence.
clause is not even there. Here is the offending code:
def characters(self , string):
if self.initem:
try:
self.data.appen d(string.encode ())
except:
self.data.appen d('No habla la Unicode')
And the exception:
File "C:\Users\Adam\ Desktop\XMLWork space.py", line 65, in characters
try:
UnicodeEncodeEr ror: 'ascii' codec can't encode character u'\u2026' in
position 83: ordinal not in range(128)
Its got to be something really dumb I'm missing, this make no sence.
Comment