Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop overriding request.json_body from webob #3447

Merged
merged 1 commit into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Features
to ``add_route`` is the empty string (``''``).
See https://github.com/Pylons/pyramid/pull/3420

- No longer define ``pyramid.request.Request.json_body`` which is already
provided by WebOb. This allows the attribute to now be settable.
See https://github.com/Pylons/pyramid/pull/3447

Bug Fixes
---------

Expand Down
11 changes: 0 additions & 11 deletions docs/api/request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,6 @@

.. automethod:: resource_path

.. attribute:: json_body

This property will return the JSON-decoded variant of the request
body. If the request body is not well-formed JSON, or there is no
body associated with this request, this property will raise an
exception.

.. seealso::

See also :ref:`request_json_body`.

.. method:: set_property(callable, name=None, reify=False)

Add a callable or a property descriptor to the request instance.
Expand Down
2 changes: 1 addition & 1 deletion docs/narr/webob.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ that has a body suitable for reading via ``request.json_body`` using Python's
import json
json_payload = json.dumps({'a':1})
headers = {'Content-Type':'application/json; charset=utf-8'}
headers = {'Content-Type':'application/json'}
req = urllib2.Request('http://localhost:6543/', json_payload, headers)
resp = urllib2.urlopen(req)
Expand Down
5 changes: 0 additions & 5 deletions src/pyramid/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections import deque
import json

from zope.interface import implementer
from zope.interface.interface import InterfaceClass
Expand Down Expand Up @@ -229,10 +228,6 @@ def is_response(self, ob):
return False
return adapted is ob

@property
def json_body(self):
return json.loads(text_(self.body, self.charset))


def route_request_iface(name, bases=()):
# zope.interface treats the __name__ as the __doc__ and changes __name__
Expand Down