Here's an example of porting changes when trying to deal with binary strings which are nothing more than serialized dictionaries (response.rendered_content
). In python 2 json.loads(response.rendered_content)
works just fine, but in python 3 I had to add .decode("utf-8")
:
# save to log
try:
- self.request.log.response = json.loads(response.rendered_content)
+ self.request.log.response = response.rendered_content.decode("utf-8")
except Exception as w: