Fix python error where certain bytes that need escaping weren't being escaped