Requests 1.0.2 + Broken JSON #1028

rdegges opened this Issue Dec 18, 2012 · 8 comments


None yet

6 participants



response.json no longer works in requests 1.0.2, instead you must call response.json() manually, which breaks a lot of library support.

Will this go back to the old way? If not, I'd be happy to update all my dependencies :o


In Kennith's blog post today he wrote:

Removal of the magic Response.json property. Replaced with a method.

I think this change is intended to stay.


And looking at the new json method, I like it. Attributes shouldn't raise exceptions realistically when accessed unless they don't exist. Making it a method and exposing a possible issue with loading the json makes far more sense than the way the old attribute worked.

@rdegges you won't be the only one updating your dependencies ;)


This is an extremely intentional change. Please read semver


Yes, it was because you shouldn't get exceptions when accessing an attribute. The old API was wrong.


Yep, I hadn't really dug into the code. But this makes far more sense.


Just weighing in as I only noticed this change today. First, @kennethreitz, I totally agree with your reasons for changing it and I'm glad you did! This is a good upgrade.

That said, I might have preferred a staged transition, like:

v 0.15.0:

  • response.json is renamed to response.json_property
  • response.json_method is the method version of response.json_property
  • response.json is a new property that issues a DeprecationWarning and returns response.json_property

End user actions: replace response.json with response.json_property throughout their code. Other co-installed projects designed for 0.14.1 can keep using response.json for now. Installations can upgrade from 0.14.1 to 0.15.0 without breakage.

v 1.0.0:

  • response.json now points to response.json_method

End user actions: replace response.json_property with response.json() throughout their code. Other co-installed projects designed for 0.15.0 can keep using response.json_property for now. Installations can upgrade from 0.15.0 to 1.0.0 without breakage.

v 1.1.0:

  • response.json_property and response.json_method are removed

I find myself in the situation where it's easy enough to upgrade the code I'm writing to use the 1.0.0 API (which I think is great!), but I have to coordinate with other departments so that we all make the from from 0.14.1 to 1.0.0 at the same moment. There's no intermediate state that supports both the old and new styles at the same time.


good info

@tjgmax tjgmax referenced this issue in lionheart/python-harvest Jun 25, 2013

Small bug in #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment