[ZODB-Dev] ZODB.FileStorage.format: TxnHeader cannot handle Unicode 'descr'

Jim Fulton jim at zope.com
Sat Oct 5 19:13:17 CEST 2013


On Sat, Oct 5, 2013 at 1:47 AM, Chao Meng <bobomeng at gmail.com> wrote:
> Hi there,
>
> Here is an issue from zopefoundation/ZODB github three months ago. I am
> facing similar issue now and don't know how to resolve.
>
> github issue link: https://github.com/zopefoundation/ZODB/issues/12
>
> When I use Pyramid+ZODB+traversal and use some Chinese characters in URL.
> Note that my resource tree saved in ZODB with unicode fine for the Chinese
> characters as object names.
>
> Basically when save transaction, ZODB.FileStorage.format TxnHeader uses
> request.path_info as it's descr, which is unicode, but TxnHeader cannot
> handle Unicode :(
>
> It would be great if anyone can help or give some pointers.

This is a Pyramid bug.

transaction.note is defined to take a bytes string.  Pyramid
should encode the path before passing it to transaction.note.

Alternatively, Pyramid could store the path in transaction
extended info, which accepts any picklable type.

Of course, we could revisit this.  If we did, I'd deprecate the
transaction user and description attributes and only support
meta data via the extended info mechanism, which I'd rename
"meta data".

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton


More information about the ZODB-Dev mailing list