fix stdout/err capturing when running with nosetest --with-xunit
decoding of tempita templates on python 2