-fixed string.encode on some python versions does not support named parameters