escape bytes for python3