On Mon, Jul 22, 2013 at 10:28:33AM +1000, Nick Coghlan wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Are Matthew's replies stuck in the python-devel moderation queue?
(Just realised the likely reason I'm only seeing half this
conversation...)
Hmm, also just realised I've been hitting Reply-List, so my replies
are only going to python-devel...
Yeah, the bulk of the conversation has been hitting the
devel
lists.fedoraproject.org list. Only a few messages have gone only to
python-devel lists.fp.o (and quite a few messages are going only to
devel lists.fp.o)
> If your needs are very minimal, python3-tempita might be a good
> choice. If you actually do need more features than that,
> python-mako and python-jinja2 are popular. Note that both of those
> have a few deps (but hopefully not as bad as cheetah). (Also --
> the python3 version of mako has less deps than the python2
> version... I think that it just because those deps haven't been
> ported to python3 yet and the package can operate with reduced
> functionality without them. the deps fo the python3 version might
> expand i nthe future).
Jinja2 is excellent, with very high quality error reporting - an oft
overlooked feature in a templating tool! (it's actually Armin
Ronacher's fault I started thinking about how to deal with the problem
of surrogate escaped strings escaping from their intended "retrieve
from OS API, pass straight back to OS API" box - he did an excellent
write-up of how this can go wrong after finishing the Werkzeug and
Jinja2 Python 3 updates: see
http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ and
http://lucumr.pocoo.org/2013/7/2/the-updated-guide-to-unicode/).
<nod> Armin Ronacher is one of the few people that I find is a reliable
ally in identifying unicode vs byte issues. Relating a bit to your earlier
email where you were talking about throwing an exception when mixing tainted
strings and my feeling that that would be a design wart -- Armin's
unicodenazi module (
https://pypi.python.org/pypi/unicode-nazi ) is an
example of trying to make errors in python2 text+bytes handling show up when
code is run regardless of the data (it still isn't perfect as someone can
give u'string' as a parameter in testing and b'string' as a parameter in
real-life but does catch a lot of places where people are successfully
mixing u'string' and b'string' only because they are only testing with an
ascii dataset.)
-Toshio