[Zope-Coders] Re: BTrees, Unicode, and Python 2.2

Guido van Rossum guido@python.org
Thu, 18 Oct 2001 12:46:38 -0400


> Try to run it with 2.1 not with 2.2. As discussed yesterday
> the error behaviour differs from 2.1 to 2.2

I'm not a mindreader.  Because the subject said 2.2 I presumed it was
a 2.2 problem.

I can now reproduce what you see.  Note that it prints "<unprintable
instance object>" in the traceback so that comes from the traceback
module.  I hacked the traceback.py file to leave this exception alone;
it's a KeyError with the key u'dreit\xe4gigen'.

The cause is the same as I explained earlier: if you compare
u'dreit\xe4gigen' to 'dreit\xe4gigen' the comparison raises a
KeyError.  

I believe the difference between the two variations of the test may
have to do with the fact that if the key is the same object some
shortcut takes place that doesn't try to compare.

Can you point me to the BTree code that does the comparison?

--Guido van Rossum (home page: http://www.python.org/~guido/)