N
Nikola Skoric
Is there a way to tell the interpreter to display exceptions, even those
which were captured with except?
which were captured with except?
Yes, sort of ... You have to trigger the display yourself within theNikola said:Is there a way to tell the interpreter to display exceptions, even those
which were captured with except?
Nikola Skoric said:Is there a way to tell the interpreter to display exceptions, even those
which were captured with except?
Paul Rubin said:Normally you wouldn't do that unless you were trying to debug the
interpreter itself. It uses caught exceptions for all sorts of things
that you probably don't want displayed. I think even ordinary loop
termination may be implemented using exceptions.
Nikola said:Traceback (most recent call last):
File "AIDbot2.py", line 238, in ?
bot.checkNominations()
File "AIDbot2.py", line 201, in checkNominations
if sect.parseSect() == 1:
File "AIDbot2.py", line 96, in parseSect
print self.sect[1].encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 15:
ordinal
not in range(128)
Now, who can it complain about 'ascii' when I said loud and clear I want
it to encode the string to 'utf-8'??? Damn unicode.
Nikola said:print self.sect[1].encode('utf-8')
Which results in:
Traceback (most recent call last):
File "AIDbot2.py", line 238, in ?
bot.checkNominations()
File "AIDbot2.py", line 201, in checkNominations
if sect.parseSect() == 1:
File "AIDbot2.py", line 96, in parseSect
print self.sect[1].encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 15:
ordinal
not in range(128)
Now, who can it complain about 'ascii' when I said loud and clear I want
it to encode the string to 'utf-8'??? Damn unicode.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.