Roundup Tracker - Issues

Message5199

Author ber
Recipients antmail, ber, pcaulagi, shammash, techtonik
Date 2015-01-30.08:14:37
Message-id <201501300914.33899.bernhard@intevation.de>
In-reply-to <CAPkN8xJFTj==0UJzY0W4iPAMz4xw5=bBgkX8Yvf6b170Luy_8A@mail.gmail.com>
> Do you mean that msg.content.hyperlinked() here is UTF8?
> <pre>{{ msg.content.hyperlinked() }}</pre>
> And that Jinja2 fails, because it expects unicode() object, and
> not binary string that is UTF8?

Yes, this is my current understanding, which my testing supported.
(I've written a patch that does  encode(x,"utf-8") in some places
and it worked (up to a point) but supported by hypothesis.)

> What if we make Roundup use unicode objects internally instead of
> binary str with UTF-8? It will solve the problem and make it forward
> compatible with Python 3.

This would be a major undertaking which puts all other places
of roundup in danger of failing. Within templating roundup calls
its own functions and it assumes utf-8 everywhere, so just changing a few 
points does not to it (tried it with a patch). 
It is an option at some time in the future of course. :)

> For now the solution may be to patch Jinja2 
> to assume that all raw strings are in UTF8 and not ASCII (which I
> think is only logical).

I thought about this, too. The drawback is that we have to bring
our own version of jinja2. In my installation jinja2 comes from the 
distribution. The other solution with the customer filter functions
works okay, and the extra  |u at places is bearable and can be easily replaced
with a dummy function or removed in the future.
History
Date User Action Args
2015-01-30 08:14:38bersetrecipients: + ber, techtonik, pcaulagi, shammash, antmail
2015-01-30 08:14:38berlinkissue2550811 messages
2015-01-30 08:14:37bercreate