Re: utf8 problem when creating SiteRoot

J C Lawrence <[email protected]>
Newsgroups gmane.comp.web.zope.zodb.dirstorage
Message-ID <[email protected]>
On Tue, 11 May 2004 16:57:18 +0200
Marcus Pettersson <[email protected]> wrote:

> Traceback...

We're getting a very similar traceback, tho in general operation, not
for a SiteRoot.

  Traceback (innermost last):

  *	Module ZPublisher.Publish, line 107, in publish
  *	Module Zope.App.startup, line 222, in commit
  *	Module ZODB.Transaction, line 247, in commit
  *	Module ZODB.Connection, line 699, in tpc_vote
  *	Module ZODB.BaseStorage, line 186, in tpc_vote
  *	Module DirectoryStorage.BaseDirectoryStorage, line 209, in _vote
  *	Module DirectoryStorage.Full, line 188, in _vote_impl

  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 7:
  ordinal not in range(128)

And in our case it appears to be related to LDAP, and in particular LDAP
data for user accounts which contain unicode strings (we're using
LDAPUserFolder).  And there of course is the problem as the LDAP DB is
run by corporate and we can't change/set/require data requirements.

Based on some further fiddling, and this isn't particularly rigorous, it
appears that the value of body in the line:

  body = struct.pack("!HHHIH",len(u),len(d),len(e),len(ob),0) + u + d + e + ob

can sometimes be a unicode string.  Which, if it doesn't blow up there,
blows up later at:

  self._transaction_directory.write(_tid_filename(td.tid), header + md5sum + body)

when the unicode conversion for other binary data fails.

So far we haven't traced this back any further than this and I'm not
sure yet at all if we should track into LDAPUserFolder or
DIrectoryStorage as the one violating their external contract.

--
J C Lawrence
---------(*)                Satan, oscillate my metallic sonatas.
[email protected]               He lived as a devil, eh?
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.