Backwards compat to python 2.7

changed bytes to encode for backwards compat to 2.7.8
passing 19/19 tests in python 3.3 and 2.7.8