Re: Python seems to be ignoring my except clause...

2008-02-20 Thread Larry Bates
Adam W. wrote: > 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.append(string.encode()) >

Re: Python seems to be ignoring my except clause...

2008-02-19 Thread Jonathan Gardner
On Feb 19, 6:14 am, "Adam W." <[EMAIL PROTECTED]> wrote: > So I deleted my .pyc files and reran, same thing, but then I closed all > open windows and reran it, and it recompiled the pyc and the code > "worked". > ... > But now I know I have to keep deleting my > pyc files or else I will run into tr

Re: Python seems to be ignoring my except clause...

2008-02-19 Thread Adam W.
On Feb 19, 8:49 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > The example you posted isn't complete and while I can easily expand it to a > working example it will unfortunately be a working example. > > Try cutting it down yourself to a minimal self-contained example that you > can post. 99% of th

Re: Python seems to be ignoring my except clause...

2008-02-19 Thread Szekeres István
Hi Adam, def characters(self, string): > Please note that "string" is also a name of a very commonly used module so it is not advised to use as a local variable name. Istvan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python seems to be ignoring my except clause...

2008-02-19 Thread Duncan Booth
"Adam W." <[EMAIL PROTECTED]> wrote: > 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