Call for help
2007-01-21
Neil Schemenauer2007-01-21
Mike Orr2007-01-21
Titus Brown2007-01-30
Titus Brown2007-01-30
Neil Schemenauer2007-01-21
Titus Brown2007-01-30
Titus Brown2007-01-30
Titus Brown2007-01-30
David Binger2007-01-30
Mike Orr2007-02-01
Mike Orr2007-02-01
David Binger2007-02-01
Mike Orr2007-02-02
Titus Brown2007-02-02
Mike Orr2007-02-02
David Binger2007-02-02
Mike Orr2007-02-05
David Binger2007-01-30
Neil Schemenauer2007-01-30
Neil Schemenauer2007-01-30
Titus BrownCall for help
Mike Orr
On 2/1/07, Titus Brown <titus@caltech.edu> wrote:
> On Thu, Feb 01, 2007 at 12:01:54PM -0800, Mike Orr wrote:
> -> So how about inlining the code into htmltext itself?
>
> Guys,
>
> I'm happy to try this, but I need some concrete examples of where
> htmltext fails and qpy succeeds, preferably expressed in Python
> code. That way I can put in some tests ;).
>>> from quixote.html import htmltext
>>> x = htmltext("Some string.")
>>> assert isinstance(x, basestring)
AssertionError
>>> "".join(["ABC", x])
TypeError: sequence item 1: expected string, htmltext found
>>> from qpy import u8
>>> y = h8("Some string.")
>>> assert isinstance(y, basestring)
>>> "".join(["ABC", y])
u'ABCSome string.'
I can't quite capture the Unicode problem.
>>> unicode(htmltext(U'\xa9')
u'\xa9'
>>> unicode(htmltext('\xa9'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa9 in position
0: ordinal not in range(128)
But that in itself is not strictly htmltext's fault. Maybe the
previous tests are enough.
--
Mike Orr <sluggoster@gmail.com>