On Tue, Sep 10, 2013 at 09:49:50AM +0200, Brian Sutherland wrote:
> On Tue, Sep 10, 2013 at 09:32:18AM +0300, Marius Gedminas wrote:
> > IIRC there's a brand new zope.testbrowser 4.1.0 with Python 3 support,
> > built on top of WebTest, waiting in the py3 branch for... Actually, I'm
> > not sure what it is waiting for.  (I thought ZODB with Python 3 support,
> > but it doesn't look like zope.testbrowser depends on ZODB, at least not
> > directly.)
> Indeed, and it's had no changes for at least 5 months and been tested
> with a few existing codebases.
> +1 for releasing it

One tests fails in the py3 branch: test_strip_linebreaks_from_textarea.

It tests that if you inspect getControl(name='textarea').value, you'll
see one initial '\n' stripped away.  This fails when the textarea in
question has two initial newlines:



The test expects .value to be '\nFoo\n', but it actually gets 'Foo\n'.

This test was added by Benji York in 2006 (commit 4545f144) and refers
to "issue 644" in some unspecified bug tracker.  Google allowed me to
find a copy of the issue in question:

In particular the following comment is interesting:

  "We've verified that browsers (we tested Firefox, Mozilla, Safari, and
  IE) will strip a single leading newline (crlf) if it is at the
  beginning of the string."
    -- Jim Fulton, https://bugs.launchpad.net/zope3/+bug/98371/comments/12

It was serious enough to warrant changes to the local copy of ClientForm
(and an upstream submission of the patch).

It looks like what happened here was that WebTest itself was modified to
eat the first newline in a textarea:


so now we eat two.

This change was released in WebTest 2.0.6:

I guess what we have to do is remove the 1st newline stripping logic
from zope.testbrowser and require WebTest >= 2.0.6.

Ok, fixed.

Marius Gedminas
http://pov.lt/ -- Zope 3/BlueBream consulting and development

Attachment: signature.asc
Description: Digital signature

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to