On 30 mars 14:35, Alexander Artemenko wrote:
> Hi,
> 
> On Tue, Mar 30, 2010 at 1:20 PM, Emile Anclin <emile.anc...@logilab.fr> wrote:
> > +                decode = stream.readline().decode
> > +                line_generator = lambda: decode(encoding)
> >
> > instead of:
> >
> > +                 line_generator = lambda:
> > stream.readline().decode(encoding)
> >
> >
> > Can somebody explain me what happened ?
> >
> > Anyhow, Appended my new patch (we use func_noerror_* if we don't want the
> > message triggered)
> 
> No, this is not ok, because decode will always return first line.

yup.

Using:

   lambda: stream.readline().decode(encoding, 'replace')

should do the trick.
-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to