Backwards compatibility for python < 3

Python 2.6 doesn't support keyword arguments for str.encode. Positional arguments work for both Python 2 and 3.  Missed one.
Merge pull request #359 from brombomb/patch-2

Backwards compatibility for python < 3