diff options
| author | Michael Merickel <michael@merickel.org> | 2015-02-06 02:06:07 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2015-02-06 02:06:48 -0600 |
| commit | d23e6986b1122e8d7344f2c882ddd3e3f423e30f (patch) | |
| tree | 4da27fa45bf58d5eeb4bdfee808158728be2f981 | |
| parent | dd22319b1b8df9b1772451035fca582bd666e218 (diff) | |
| download | pyramid-d23e6986b1122e8d7344f2c882ddd3e3f423e30f.tar.gz pyramid-d23e6986b1122e8d7344f2c882ddd3e3f423e30f.tar.bz2 pyramid-d23e6986b1122e8d7344f2c882ddd3e3f423e30f.zip | |
update changelog and docs
| -rw-r--r-- | CHANGES.txt | 10 | ||||
| -rw-r--r-- | pyramid/renderers.py | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index b334f5258..30f30cec7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -80,6 +80,16 @@ Features - Support keyword-only arguments and function annotations in views in Python 3. See https://github.com/Pylons/pyramid/pull/1556 +- ``request.response`` will no longer be mutated when using the + ``pyramid.renderers.render_to_response()`` API. Almost all renderers + mutate the ``request.response`` response object (for example, the JSON + renderer sets ``request.response.content_type`` to ``application/json``). + However, when invoking ``render_to_response`` it is not expected that the + response object being returned would be the same one used later in the + request. The response object returned from ``render_to_response`` is now + explicitly different from ``request.response``. This does not change the + API of a renderers. See https://github.com/Pylons/pyramid/pull/1563 + Bug Fixes --------- diff --git a/pyramid/renderers.py b/pyramid/renderers.py index c2be8c2eb..42a4c98dc 100644 --- a/pyramid/renderers.py +++ b/pyramid/renderers.py @@ -110,9 +110,9 @@ def render_to_response(renderer_name, value, request=None, package=None): Supply a ``request`` parameter in order to provide the renderer with the most correct 'system' values (``request`` and ``context`` - in particular). Keep in mind that if the ``request`` parameter is - not passed in, any changes to ``request.response`` attributes made - before calling this function will be ignored. + in particular). Keep in mind that any changes made to ``request.response`` + prior to calling this function will not be reflected in the resulting + response object. A new response object will be created for each call. """ try: |
