[ZODB-Dev] ZODB4 and DemoStorage

Barry Warsaw barry@python.org
09 Apr 2003 10:46:56 -0400


On Wed, 2003-04-09 at 04:32, Marius Gedminas wrote:

> > ext is u'' there for some reason.  I'll try to investigate.
> 
> I think I found the cause.  Transaction metadata consists of three
> things: user, description and ext.  First two are (or can be) Unicode
> strings (both principal IDs and locations in Zope 3 are Unicode
> strings), the third one is a pickle.  They are all concatenated into a
> single Unicode string in BDBFullStorage._dobegin and split in _doundolog
> and _nexttxn.  That's how ext becomes a unicode object instead of an
> empty string.
> 
> Any ideas on fixing this?  I suppose user and description should be
> converted to plain strings (in UTF-8) and then later converted back to
> unicode, but I am not sure where exactly.

Nice sleuthing.  I'll add a test case and a fix, but something like what
you suggest seems right.

-Barry