.encode on python-2.6 does not take keyword arguments