On 1/16/2014 9:16 AM, Steven D'Aprano wrote:
On Thu, 16 Jan 2014 13:34:08 +0100, Ernest Adrogué wrote:
Hi,
There seems to be some inconsistency in the way exceptions handle
Unicode strings.
Yes. I believe the problem lies in the __str__ method. For example,
KeyError manages to handle Unicode
On 1/16/2014 7:34 AM, Ernest Adrogué wrote:
Hi,
There seems to be some inconsistency in the way exceptions handle Unicode
strings. For instance, KeyError seems to not have a problem with them
raise KeyError('a')
Traceback (most recent call last):
File "", line 1, in
KeyError: 'a'
raise
In article <52d7e9a0$0$2$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Thu, 16 Jan 2014 13:34:08 +0100, Ernest Adrogué wrote:
>
> > Hi,
> >
> > There seems to be some inconsistency in the way exceptions handle
> > Unicode strings.
>
> Yes. I believe the problem lies in
On Thu, 16 Jan 2014 13:34:08 +0100, Ernest Adrogué wrote:
> Hi,
>
> There seems to be some inconsistency in the way exceptions handle
> Unicode strings.
Yes. I believe the problem lies in the __str__ method. For example,
KeyError manages to handle Unicode, although in an ugly way:
py> str(KeyE
Hi,
There seems to be some inconsistency in the way exceptions handle Unicode
strings. For instance, KeyError seems to not have a problem with them
>>> raise KeyError('a')
Traceback (most recent call last):
File "", line 1, in
KeyError: 'a'
>>> raise KeyError(u'ä')
Traceback (most recent call