[Zope3-dev] Publisher bug

Roger Ineichen dev at projekt01.ch
Mon Sep 19 09:59:59 EDT 2005


Hi Velko


> -----Original Message-----
> From: Velko Ivanov [mailto:dachev at nove.bg] 
> Sent: Monday, September 19, 2005 12:57 PM
> To: dev at projekt01.ch
> Cc: zope3-dev at zope.org
> Subject: Re: [Zope3-dev] Publisher bug
> 
> Roger Ineichen wrote:
> 
> > Exception Type
> > UnicodeDecodeError
> > Exception Value
> > 'ascii' codec can't decode byte 0xc3 in position 891: ordinal not in
> > range(128)
> > ...
> > body = ('%s\n<base href="%s" />\n%s' % 
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in 
> position 891:
> > ordinal not in range(128) 
> 
> I got plenty of these recently, but it was all my fault. I 
> was trying to 
> output some unicode strings with non-english characters and 
> it took me 
> some time until I got it right.
> If you have strings in .py files, which contain non-english 
> characters, 
> try the following:
> 
> - save your .py files as utf8
> - put a comment on the first, or second line of the file:
>    # coding: utf8
>    this takes care of python's warning
> - decode all offending strings:
>    'some string'.decode('utf8')

I see, I also run into such a error useing a textfile as a import
where I parse the lines and present them as content in a view.
Fix the encoding will work i this situation.

But my issue is more problematic because the same view on a object
will raise into this exception and a view on a copy of the object
will not raise this exception. After move the ZODB on another server
useing the same source code of z3 and our project the exception is gone.
Also the error is gone after restart on the main server where the error 
happens first.

The biggest problem right now is, that I can't reproduce the issue 
again after restart the server.

Regards
Roger Ineichen

Projekt01 GmbH
www.projekt01.ch
_____________________________
END OF MESSAGE  

> Regards,
> Velko Ivanov
> 



More information about the Zope3-dev mailing list