Re: Call for help

"Mike Orr" <[email protected]> Thu, 1 Feb 2007 16:27:15 -0800
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
On 2/1/07, Titus Brown <[email protected]> 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 <[email protected]>