Steve Piercy
2017-05-17 8c4d422965b633f31967ceed1e6cc25cc616d0bf
commit | author | age
1fc7ee 1 1.9a2 (2017-05-09)
MM 2 ==================
3
4 Backward Incompatibilities
5 --------------------------
6
7 - ``request.exception`` and ``request.exc_info`` will only be set if the
8   response was generated by the EXCVIEW tween. This is to avoid any confusion
9   where a response was generated elsewhere in the pipeline and not in
10   direct relation to the original exception. If anyone upstream wants to
11   catch and render responses for exceptions they should set
12   ``request.exception`` and ``request.exc_info`` themselves to indicate
13   the exception that was squashed when generating the response.
14
15   Similar behavior occurs with ``request.invoke_exception_view`` in which
16   the exception properties are set to reflect the exception if a response
17   is successfully generated by the method.
18
19   This is a very minor incompatibility. Most tweens right now would give
20   priority to the raised exception and ignore ``request.exception``. This
21   change just improves and clarifies that bookkeeping by trying to be
22   more clear about the relationship between the response and its squashed
23   exception. See https://github.com/Pylons/pyramid/pull/3029 and
24   https://github.com/Pylons/pyramid/pull/3031
25
c84904 26 1.9a1 (2017-05-01)
MM 27 ==================
bdb8e0 28
fa8a9d 29 Major Features
MM 30 --------------
31
32 - The file format used by all ``p*`` command line scripts such as ``pserve``
33   and ``pshell``, as well as the ``pyramid.paster.bootstrap`` function
34   is now replaceable thanks to a new dependency on
f454b8 35   `plaster <http://docs.pylonsproject.org/projects/plaster/en/latest/>`_.
fa8a9d 36
MM 37   For now, Pyramid is still shipping with integrated support for the
fdd77d 38   PasteDeploy INI format by depending on the
fbfd81 39   `plaster_pastedeploy <https://github.com/Pylons/plaster_pastedeploy>`_
fdd77d 40   binding library. This may change in the future.
fa8a9d 41
MM 42   See https://github.com/Pylons/pyramid/pull/2985
5f4649 43
4c3971 44 - Added an execution policy hook to the request pipeline. An execution
MM 45   policy has the ability to control creation and execution of the request
f454b8 46   objects before they enter the rest of the pipeline. This means for a single
fa8a9d 47   request environ the policy may create more than one request object.
MM 48
49   The first library to use this feature is
50   `pyramid_retry
f454b8 51   <http://docs.pylonsproject.org/projects/pyramid-retry/en/latest/>`_.
fa8a9d 52
MM 53   See https://github.com/Pylons/pyramid/pull/2964
54
6419a3 55 - CSRF support has been refactored out of sessions and into its own
MM 56   independent API in the ``pyramid.csrf`` module. It supports a pluggable
57   ``pyramid.interfaces.ICSRFStoragePolicy`` which can be used to define your
58   own mechanism for generating and validating CSRF tokens. By default,
59   Pyramid continues to use the ``pyramid.csrf.LegacySessionCSRFStoragePolicy``
60   that uses the ``request.session.get_csrf_token`` and
61   ``request.session.new_csrf_token`` APIs under the hood to preserve
62   compatibility. Two new policies are shipped as well,
63   ``pyramid.csrf.SessionCSRFStoragePolicy`` and
64   ``pyramid.csrf.CookieCSRFStoragePolicy`` which will store the CSRF tokens
65   in the session and in a standalone cookie, respectively. The storage policy
66   can be changed by using the new
67   ``pyramid.config.Configurator.set_csrf_storage_policy`` config directive.
68
69   CSRF tokens should be used via the new ``pyramid.csrf.get_csrf_token``,
70   ``pyramid.csrf.new_csrf_token`` and ``pyramid.csrf.check_csrf_token`` APIs
71   in order to continue working if the storage policy is changed. Also, the
72   ``pyramid.csrf.get_csrf_token`` function is injected into templates to be
73   used conveniently in UI code.
74
682a9b 75   See https://github.com/Pylons/pyramid/pull/2854 and
MM 76   https://github.com/Pylons/pyramid/pull/3019
a2c7c7 77
2b9b6c 78 Minor Features
MM 79 --------------
9028c9 80
MM 81 - Support an ``open_url`` config setting in the ``pserve`` section of the
82   config file. This url is used to open a web browser when ``pserve --browser``
83   is invoked. When this setting is unavailable the ``pserve`` script will
84   attempt to guess the port the server is using from the
85   ``server:<server_name>`` section of the config file but there is no
86   requirement that the server is being run in this format so it may fail.
87   See https://github.com/Pylons/pyramid/pull/2984
88
87af11 89 - The ``pyramid.config.Configurator`` can now be used as a context manager
MM 90   which will automatically push/pop threadlocals (similar to
91   ``config.begin()`` and ``config.end()``). It will also automatically perform
92   a ``config.commit()`` and thus it is only recommended to be used at the
93   top-level of your app. See https://github.com/Pylons/pyramid/pull/2874
a2c7c7 94
847fb7 95 - The threadlocals are now available inside any function invoked via
MM 96   ``config.include``. This means the only config-time code that cannot rely
97   on threadlocals is code executed from non-actions inside the main. This
98   can be alleviated by invoking ``config.begin()`` and ``config.end()``
99   appropriately or using the new context manager feature of the configurator.
100   See https://github.com/Pylons/pyramid/pull/2989
101
1cf132 102 Bug Fixes
BJR 103 ---------
45f882 104
564b63 105 - HTTPException's accepts a detail kwarg that may be used to pass additional
BJR 106   details to the exception. You may now pass objects so long as they have a
169155 107   valid __str__ method. See https://github.com/Pylons/pyramid/pull/2951
MM 108
109 - Fix a reference cycle causing memory leaks in which the registry
110   would keep a ``Configurator`` instance alive even after the configurator
111   was discarded. Another fix was also added for the ``global_registries``
112   object in which the registry was stored in a closure preventing it from
113   being deallocated. See https://github.com/Pylons/pyramid/pull/2967
564b63 114
38294e 115 - Fix a bug directly invoking ``pyramid.scripts.pserve.main`` with the
MM 116   ``--reload`` option in which ``sys.argv`` is always used in the subprocess
117   instead of the supplied ``argv``.
118   See https://github.com/Pylons/pyramid/pull/2962
119
1cf132 120 Deprecations
BJR 121 ------------
cb98a9 122
2b9b6c 123 - Pyramid currently depends on ``plaster_pastedeploy`` to simplify the
MM 124   transition to ``plaster`` by maintaining integrated support for INI files.
125   This dependency on ``plaster_pastedeploy`` should be considered subject to
2aebc6 126   Pyramid's deprecation policy and may be removed in the future.
2b9b6c 127   Applications should depend on the appropriate plaster binding to satisfy
MM 128   their needs.
d2f0fe 129
2b9b6c 130 - Retrieving CSRF token from the session has been deprecated in favor of
MM 131   equivalent methods in the ``pyramid.csrf`` module. The CSRF methods
132   (``ISession.get_csrf_token`` and ``ISession.new_csrf_token``) are no longer
133   required on the ``ISession`` interface except when using the default
134   ``pyramid.csrf.LegacySessionCSRFStoragePolicy``.
a2c7c7 135
2b9b6c 136   Also, ``pyramid.session.check_csrf_token`` is now located at
MM 137   ``pyramid.csrf.check_csrf_token``.
138
139   See https://github.com/Pylons/pyramid/pull/2854 and
140   https://github.com/Pylons/pyramid/pull/3019
3213e2 141
785088 142 Documentation Changes
MM 143 ---------------------
144
145 - Added the execution policy to the routing diagram in the Request Processing
840508 146   chapter. See https://github.com/Pylons/pyramid/pull/2993