datacenter / acitoolkit

A basic toolkit for accessing the Cisco APIC
Other
347 stars 266 forks source link

cannot use json() on requests in python 3.6 (TypeError: must be str, not bytes) #352

Closed victorcamposm closed 4 years ago

victorcamposm commented 4 years ago

When you try to get Session and the response is too big, it falls into acisession.py line 848: image

If you are using python3, you receive the following error:

image

This error is because you need to encode the response content (line 875) to ascii (to provide support to python3) like this image

Here you have more details from requests project https://github.com/psf/requests/issues/4879#issue-384447145