Michael Merickel
2017-06-20 5aa1afbb216a800a420ffa6121a54b4ea194482b
commit | author | age
37d887 1 unreleased
MM 2 ==========
3
4 - Add an informative error message when unknown predicates are supplied. The
5   new message suggests alternatives based on the list of known predicates.
6   See https://github.com/Pylons/pyramid/pull/3054
7
50d216 8 - Added integrity attributes for JavaScripts in cookiecutters, scaffolds, and
SP 9   resulting source files in tutorials.
10   See https://github.com/Pylons/pyramid/issues/2548
11
d179ce 12 - Update RELEASING.txt for updating cookiecutters. Change cookiecutter URLs to
SP 13   use shortcut.
cc8ce5 14   See https://github.com/Pylons/pyramid/issues/3042
MM 15
16 - Ensure the correct threadlocals are pushed during view execution when
17   invoked from ``request.invoke_exception_view``.
18   See https://github.com/Pylons/pyramid/pull/3060
d179ce 19
7b3249 20 - Fix a bug in which ``pyramid.security.ALL_PERMISSIONS`` failed to return
MM 21   a valid iterator in its ``__iter__`` implementation.
22   See https://github.com/Pylons/pyramid/pull/3074
23
b54a70 24 - Normalize the permission results to a proper class hierarchy.
MM 25   ``pyramid.security.ACLAllowed`` is now a subclass of
975b02 26   ``pyramid.security.Allowed`` and ``pyramid.security.ACLDenied`` is now a
b54a70 27   subclass of ``pyramid.security.Denied``.
MM 28   See https://github.com/Pylons/pyramid/pull/3084
29
5c437a 30 - Add a ``quote_via`` argument to ``pyramid.encode.urlencode`` to follow
MM 31   the stdlib's version and enable custom quoting functions.
32   See https://github.com/Pylons/pyramid/pull/3088
33
983216 34 - Support `_query=None` and `_anchor=None` in ``request.route_url`` as well
MM 35   as ``query=None`` and ``anchor=None`` in ``request.resource_url``.
36   Previously this would cause an `?` and a `#`, respectively, in the url
37   with nothing after it.
38   See https://github.com/Pylons/pyramid/pull/3034
39
5aa1af 40 - Revamp the ``IRouter`` API used by ``IExecutionPolicy`` to force
MM 41   pushing/popping the request threadlocals. The
42   ``IRouter.make_request(environ)`` API has been replaced by
43   ``IRouter.request_context(environ)`` which should be used as a context
44   manager. See https://github.com/Pylons/pyramid/pull/3086
45
1fc7ee 46 1.9a2 (2017-05-09)
MM 47 ==================
48
49 Backward Incompatibilities
50 --------------------------
51
52 - ``request.exception`` and ``request.exc_info`` will only be set if the
53   response was generated by the EXCVIEW tween. This is to avoid any confusion
54   where a response was generated elsewhere in the pipeline and not in
55   direct relation to the original exception. If anyone upstream wants to
56   catch and render responses for exceptions they should set
57   ``request.exception`` and ``request.exc_info`` themselves to indicate
58   the exception that was squashed when generating the response.
59
60   Similar behavior occurs with ``request.invoke_exception_view`` in which
61   the exception properties are set to reflect the exception if a response
62   is successfully generated by the method.
63
64   This is a very minor incompatibility. Most tweens right now would give
65   priority to the raised exception and ignore ``request.exception``. This
66   change just improves and clarifies that bookkeeping by trying to be
67   more clear about the relationship between the response and its squashed
68   exception. See https://github.com/Pylons/pyramid/pull/3029 and
69   https://github.com/Pylons/pyramid/pull/3031
70
c84904 71 1.9a1 (2017-05-01)
MM 72 ==================
bdb8e0 73
fa8a9d 74 Major Features
MM 75 --------------
76
77 - The file format used by all ``p*`` command line scripts such as ``pserve``
78   and ``pshell``, as well as the ``pyramid.paster.bootstrap`` function
79   is now replaceable thanks to a new dependency on
f454b8 80   `plaster <http://docs.pylonsproject.org/projects/plaster/en/latest/>`_.
fa8a9d 81
MM 82   For now, Pyramid is still shipping with integrated support for the
fdd77d 83   PasteDeploy INI format by depending on the
fbfd81 84   `plaster_pastedeploy <https://github.com/Pylons/plaster_pastedeploy>`_
fdd77d 85   binding library. This may change in the future.
fa8a9d 86
MM 87   See https://github.com/Pylons/pyramid/pull/2985
5f4649 88
4c3971 89 - Added an execution policy hook to the request pipeline. An execution
MM 90   policy has the ability to control creation and execution of the request
f454b8 91   objects before they enter the rest of the pipeline. This means for a single
fa8a9d 92   request environ the policy may create more than one request object.
MM 93
94   The first library to use this feature is
95   `pyramid_retry
f454b8 96   <http://docs.pylonsproject.org/projects/pyramid-retry/en/latest/>`_.
fa8a9d 97
MM 98   See https://github.com/Pylons/pyramid/pull/2964
99
6419a3 100 - CSRF support has been refactored out of sessions and into its own
MM 101   independent API in the ``pyramid.csrf`` module. It supports a pluggable
102   ``pyramid.interfaces.ICSRFStoragePolicy`` which can be used to define your
103   own mechanism for generating and validating CSRF tokens. By default,
104   Pyramid continues to use the ``pyramid.csrf.LegacySessionCSRFStoragePolicy``
105   that uses the ``request.session.get_csrf_token`` and
106   ``request.session.new_csrf_token`` APIs under the hood to preserve
107   compatibility. Two new policies are shipped as well,
108   ``pyramid.csrf.SessionCSRFStoragePolicy`` and
109   ``pyramid.csrf.CookieCSRFStoragePolicy`` which will store the CSRF tokens
110   in the session and in a standalone cookie, respectively. The storage policy
111   can be changed by using the new
112   ``pyramid.config.Configurator.set_csrf_storage_policy`` config directive.
113
114   CSRF tokens should be used via the new ``pyramid.csrf.get_csrf_token``,
115   ``pyramid.csrf.new_csrf_token`` and ``pyramid.csrf.check_csrf_token`` APIs
116   in order to continue working if the storage policy is changed. Also, the
117   ``pyramid.csrf.get_csrf_token`` function is injected into templates to be
118   used conveniently in UI code.
119
682a9b 120   See https://github.com/Pylons/pyramid/pull/2854 and
MM 121   https://github.com/Pylons/pyramid/pull/3019
a2c7c7 122
2b9b6c 123 Minor Features
MM 124 --------------
9028c9 125
MM 126 - Support an ``open_url`` config setting in the ``pserve`` section of the
127   config file. This url is used to open a web browser when ``pserve --browser``
128   is invoked. When this setting is unavailable the ``pserve`` script will
129   attempt to guess the port the server is using from the
130   ``server:<server_name>`` section of the config file but there is no
131   requirement that the server is being run in this format so it may fail.
132   See https://github.com/Pylons/pyramid/pull/2984
133
87af11 134 - The ``pyramid.config.Configurator`` can now be used as a context manager
MM 135   which will automatically push/pop threadlocals (similar to
136   ``config.begin()`` and ``config.end()``). It will also automatically perform
137   a ``config.commit()`` and thus it is only recommended to be used at the
138   top-level of your app. See https://github.com/Pylons/pyramid/pull/2874
a2c7c7 139
847fb7 140 - The threadlocals are now available inside any function invoked via
MM 141   ``config.include``. This means the only config-time code that cannot rely
142   on threadlocals is code executed from non-actions inside the main. This
143   can be alleviated by invoking ``config.begin()`` and ``config.end()``
144   appropriately or using the new context manager feature of the configurator.
145   See https://github.com/Pylons/pyramid/pull/2989
146
1cf132 147 Bug Fixes
BJR 148 ---------
45f882 149
564b63 150 - HTTPException's accepts a detail kwarg that may be used to pass additional
BJR 151   details to the exception. You may now pass objects so long as they have a
169155 152   valid __str__ method. See https://github.com/Pylons/pyramid/pull/2951
MM 153
154 - Fix a reference cycle causing memory leaks in which the registry
155   would keep a ``Configurator`` instance alive even after the configurator
156   was discarded. Another fix was also added for the ``global_registries``
157   object in which the registry was stored in a closure preventing it from
158   being deallocated. See https://github.com/Pylons/pyramid/pull/2967
564b63 159
38294e 160 - Fix a bug directly invoking ``pyramid.scripts.pserve.main`` with the
MM 161   ``--reload`` option in which ``sys.argv`` is always used in the subprocess
162   instead of the supplied ``argv``.
163   See https://github.com/Pylons/pyramid/pull/2962
164
1cf132 165 Deprecations
BJR 166 ------------
cb98a9 167
2b9b6c 168 - Pyramid currently depends on ``plaster_pastedeploy`` to simplify the
MM 169   transition to ``plaster`` by maintaining integrated support for INI files.
170   This dependency on ``plaster_pastedeploy`` should be considered subject to
2aebc6 171   Pyramid's deprecation policy and may be removed in the future.
2b9b6c 172   Applications should depend on the appropriate plaster binding to satisfy
MM 173   their needs.
d2f0fe 174
2b9b6c 175 - Retrieving CSRF token from the session has been deprecated in favor of
MM 176   equivalent methods in the ``pyramid.csrf`` module. The CSRF methods
177   (``ISession.get_csrf_token`` and ``ISession.new_csrf_token``) are no longer
178   required on the ``ISession`` interface except when using the default
179   ``pyramid.csrf.LegacySessionCSRFStoragePolicy``.
a2c7c7 180
2b9b6c 181   Also, ``pyramid.session.check_csrf_token`` is now located at
MM 182   ``pyramid.csrf.check_csrf_token``.
183
184   See https://github.com/Pylons/pyramid/pull/2854 and
185   https://github.com/Pylons/pyramid/pull/3019
3213e2 186
785088 187 Documentation Changes
MM 188 ---------------------
189
190 - Added the execution policy to the routing diagram in the Request Processing
840508 191   chapter. See https://github.com/Pylons/pyramid/pull/2993