Michael Merickel
2018-10-26 035f6cf8238211d097c991677fde6b5bc046a57b
commit | author | age
884eb5 1 1.9 (2017-06-26)
MM 2 ================
3
4 - No major changes from 1.9b1.
5
6 - Updated documentation links for ``docs.pylonsproject.org`` to use HTTPS.
7
8 1.9b1 (2017-06-19)
9 ==================
10
11 - Add an informative error message when unknown predicates are supplied. The
12   new message suggests alternatives based on the list of known predicates.
13   See https://github.com/Pylons/pyramid/pull/3054
14
15 - Added integrity attributes for JavaScripts in cookiecutters, scaffolds, and
16   resulting source files in tutorials.
17   See https://github.com/Pylons/pyramid/issues/2548
18
19 - Update RELEASING.txt for updating cookiecutters. Change cookiecutter URLs to
20   use shortcut.
21   See https://github.com/Pylons/pyramid/issues/3042
22
23 - Ensure the correct threadlocals are pushed during view execution when
24   invoked from ``request.invoke_exception_view``.
25   See https://github.com/Pylons/pyramid/pull/3060
26
27 - Fix a bug in which ``pyramid.security.ALL_PERMISSIONS`` failed to return
28   a valid iterator in its ``__iter__`` implementation.
29   See https://github.com/Pylons/pyramid/pull/3074
30
31 - Normalize the permission results to a proper class hierarchy.
32   ``pyramid.security.ACLAllowed`` is now a subclass of
33   ``pyramid.security.Allowed`` and ``pyramid.security.ACLDenied`` is now a
34   subclass of ``pyramid.security.Denied``.
35   See https://github.com/Pylons/pyramid/pull/3084
36
37 - Add a ``quote_via`` argument to ``pyramid.encode.urlencode`` to follow
38   the stdlib's version and enable custom quoting functions.
39   See https://github.com/Pylons/pyramid/pull/3088
40
41 - Support `_query=None` and `_anchor=None` in ``request.route_url`` as well
42   as ``query=None`` and ``anchor=None`` in ``request.resource_url``.
43   Previously this would cause an `?` and a `#`, respectively, in the url
44   with nothing after it. Now the unnecessary parts are dropped from the
45   generated URL. See https://github.com/Pylons/pyramid/pull/3034
46
47 - Revamp the ``IRouter`` API used by ``IExecutionPolicy`` to force
48   pushing/popping the request threadlocals. The
49   ``IRouter.make_request(environ)`` API has been replaced by
50   ``IRouter.request_context(environ)`` which should be used as a context
51   manager. See https://github.com/Pylons/pyramid/pull/3086
52
53 1.9a2 (2017-05-09)
54 ==================
55
56 Backward Incompatibilities
57 --------------------------
58
59 - ``request.exception`` and ``request.exc_info`` will only be set if the
60   response was generated by the EXCVIEW tween. This is to avoid any confusion
61   where a response was generated elsewhere in the pipeline and not in
62   direct relation to the original exception. If anyone upstream wants to
63   catch and render responses for exceptions they should set
64   ``request.exception`` and ``request.exc_info`` themselves to indicate
65   the exception that was squashed when generating the response.
66
67   Similar behavior occurs with ``request.invoke_exception_view`` in which
68   the exception properties are set to reflect the exception if a response
69   is successfully generated by the method.
70
71   This is a very minor incompatibility. Most tweens right now would give
72   priority to the raised exception and ignore ``request.exception``. This
73   change just improves and clarifies that bookkeeping by trying to be
74   more clear about the relationship between the response and its squashed
75   exception. See https://github.com/Pylons/pyramid/pull/3029 and
76   https://github.com/Pylons/pyramid/pull/3031
77
78 1.9a1 (2017-05-01)
79 ==================
80
81 Major Features
82 --------------
83
84 - The file format used by all ``p*`` command line scripts such as ``pserve``
85   and ``pshell``, as well as the ``pyramid.paster.bootstrap`` function
86   is now replaceable thanks to a new dependency on
87   `plaster <https://docs.pylonsproject.org/projects/plaster/en/latest/>`_.
88
89   For now, Pyramid is still shipping with integrated support for the
90   PasteDeploy INI format by depending on the
91   `plaster_pastedeploy <https://github.com/Pylons/plaster_pastedeploy>`_
92   binding library. This may change in the future.
93
94   See https://github.com/Pylons/pyramid/pull/2985
95
96 - Added an execution policy hook to the request pipeline. An execution
97   policy has the ability to control creation and execution of the request
98   objects before they enter the rest of the pipeline. This means for a single
99   request environ the policy may create more than one request object.
100
101   The first library to use this feature is
102   `pyramid_retry
103   <https://docs.pylonsproject.org/projects/pyramid-retry/en/latest/>`_.
104
105   See https://github.com/Pylons/pyramid/pull/2964
106
107 - CSRF support has been refactored out of sessions and into its own
108   independent API in the ``pyramid.csrf`` module. It supports a pluggable
109   ``pyramid.interfaces.ICSRFStoragePolicy`` which can be used to define your
110   own mechanism for generating and validating CSRF tokens. By default,
111   Pyramid continues to use the ``pyramid.csrf.LegacySessionCSRFStoragePolicy``
112   that uses the ``request.session.get_csrf_token`` and
113   ``request.session.new_csrf_token`` APIs under the hood to preserve
114   compatibility. Two new policies are shipped as well,
115   ``pyramid.csrf.SessionCSRFStoragePolicy`` and
116   ``pyramid.csrf.CookieCSRFStoragePolicy`` which will store the CSRF tokens
117   in the session and in a standalone cookie, respectively. The storage policy
118   can be changed by using the new
119   ``pyramid.config.Configurator.set_csrf_storage_policy`` config directive.
120
121   CSRF tokens should be used via the new ``pyramid.csrf.get_csrf_token``,
122   ``pyramid.csrf.new_csrf_token`` and ``pyramid.csrf.check_csrf_token`` APIs
123   in order to continue working if the storage policy is changed. Also, the
124   ``pyramid.csrf.get_csrf_token`` function is injected into templates to be
125   used conveniently in UI code.
126
127   See https://github.com/Pylons/pyramid/pull/2854 and
128   https://github.com/Pylons/pyramid/pull/3019
129
130 Minor Features
131 --------------
132
133 - Support an ``open_url`` config setting in the ``pserve`` section of the
134   config file. This url is used to open a web browser when ``pserve --browser``
135   is invoked. When this setting is unavailable the ``pserve`` script will
136   attempt to guess the port the server is using from the
137   ``server:<server_name>`` section of the config file but there is no
138   requirement that the server is being run in this format so it may fail.
139   See https://github.com/Pylons/pyramid/pull/2984
140
141 - The ``pyramid.config.Configurator`` can now be used as a context manager
142   which will automatically push/pop threadlocals (similar to
143   ``config.begin()`` and ``config.end()``). It will also automatically perform
144   a ``config.commit()`` and thus it is only recommended to be used at the
145   top-level of your app. See https://github.com/Pylons/pyramid/pull/2874
146
147 - The threadlocals are now available inside any function invoked via
148   ``config.include``. This means the only config-time code that cannot rely
149   on threadlocals is code executed from non-actions inside the main. This
150   can be alleviated by invoking ``config.begin()`` and ``config.end()``
151   appropriately or using the new context manager feature of the configurator.
152   See https://github.com/Pylons/pyramid/pull/2989
153
154 Bug Fixes
155 ---------
156
157 - HTTPException's accepts a detail kwarg that may be used to pass additional
158   details to the exception. You may now pass objects so long as they have a
159   valid __str__ method. See https://github.com/Pylons/pyramid/pull/2951
160
161 - Fix a reference cycle causing memory leaks in which the registry
162   would keep a ``Configurator`` instance alive even after the configurator
163   was discarded. Another fix was also added for the ``global_registries``
164   object in which the registry was stored in a closure preventing it from
165   being deallocated. See https://github.com/Pylons/pyramid/pull/2967
166
167 - Fix a bug directly invoking ``pyramid.scripts.pserve.main`` with the
168   ``--reload`` option in which ``sys.argv`` is always used in the subprocess
169   instead of the supplied ``argv``.
170   See https://github.com/Pylons/pyramid/pull/2962
171
172 Deprecations
173 ------------
174
175 - Pyramid currently depends on ``plaster_pastedeploy`` to simplify the
176   transition to ``plaster`` by maintaining integrated support for INI files.
177   This dependency on ``plaster_pastedeploy`` should be considered subject to
178   Pyramid's deprecation policy and may be removed in the future.
179   Applications should depend on the appropriate plaster binding to satisfy
180   their needs.
181
182 - Retrieving CSRF token from the session has been deprecated in favor of
183   equivalent methods in the ``pyramid.csrf`` module. The CSRF methods
184   (``ISession.get_csrf_token`` and ``ISession.new_csrf_token``) are no longer
185   required on the ``ISession`` interface except when using the default
186   ``pyramid.csrf.LegacySessionCSRFStoragePolicy``.
187
188   Also, ``pyramid.session.check_csrf_token`` is now located at
189   ``pyramid.csrf.check_csrf_token``.
190
191   See https://github.com/Pylons/pyramid/pull/2854 and
192   https://github.com/Pylons/pyramid/pull/3019
193
194 Documentation Changes
195 ---------------------
196
197 - Added the execution policy to the routing diagram in the Request Processing
198   chapter. See https://github.com/Pylons/pyramid/pull/2993
199
b38bbf 200 1.8 (2017-01-21)
MM 201 ================
202
203 - No major changes from 1.8b1.
204
205 1.8b1 (2017-01-17)
206 ==================
207
208 Features
209 --------
210
211 - Added an ``override`` option to ``config.add_translation_dirs`` to allow
212   later calls to place translation directories at a higher priority than
213   earlier calls. See https://github.com/Pylons/pyramid/pull/2902
214
215 Documentation Changes
216 ---------------------
217
218 - Improve registry documentation to discuss uses as a component registry
219   and as a dictionary. See https://github.com/Pylons/pyramid/pull/2893
220
221 - Quick Tour, Quick Tutorial, and most other remaining documentation updated to
222   use cookiecutters instead of pcreate and scaffolds.
223   See https://github.com/Pylons/pyramid/pull/2888 and
224   https://github.com/Pylons/pyramid/pull/2889
225
226 - Fix unittests in wiki2 to work without different dependencies between
227   py2 and py3. See https://github.com/Pylons/pyramid/pull/2899
228
229 - Update Windows documentation to track newer Python 3 improvements to the
230   installer. See https://github.com/Pylons/pyramid/pull/2900
231
232 - Updated the ``mod_wsgi`` tutorial to use cookiecutters and Apache 2.4+.
233   See https://github.com/Pylons/pyramid/pull/2901
234
235 1.8a1 (2016-12-25)
236 ==================
237
238 Backward Incompatibilities
239 --------------------------
240
241 - Support for the ``IContextURL`` interface that was deprecated in Pyramid 1.3
242   has been removed.  See https://github.com/Pylons/pyramid/pull/2822
243
244 - Following the Pyramid deprecation period (1.6 -> 1.8),
245   daemon support for pserve has been removed. This includes removing the
246   daemon commands (start, stop, restart, status) as well as the following
247   arguments: ``--daemon``, ``--pid-file``, ``--log-file``,
248   ``--monitor-restart``, ``--status``, ``--user``, ``--group``,
249   ``--stop-daemon``
250
251   To run your server as a daemon you should use a process manager instead of
252   pserve.
253
254   See https://github.com/Pylons/pyramid/pull/2615
255
256 - ``pcreate`` is now interactive by default. You will be prompted if a file
257   already exists with different content. Previously if there were similar
258   files it would silently skip them unless you specified ``--interactive``
259   or ``--overwrite``.
260   See https://github.com/Pylons/pyramid/pull/2775
261
262 - Removed undocumented argument ``cachebust_match`` from
263   ``pyramid.static.static_view``. This argument was shipped accidentally
264   in Pyramid 1.6. See https://github.com/Pylons/pyramid/pull/2681
265
266 - Change static view to avoid setting the ``Content-Encoding`` response header
267   to an encoding guessed using Python's ``mimetypes`` module. This was causing
268   clients to decode the content of gzipped files when downloading them. The
269   client would end up with a ``foo.txt.gz`` file on disk that was already
270   decoded, thus should really be ``foo.txt``. Also, the ``Content-Encoding``
271   should only have been used if the client itself broadcast support for the
272   encoding via ``Accept-Encoding`` request headers.
273   See https://github.com/Pylons/pyramid/pull/2810
274
275 - Settings are no longer accessible as attributes on the settings object
276   (e.g. ``request.registry.settings.foo``). This was deprecated in Pyramid 1.2.
277   See https://github.com/Pylons/pyramid/pull/2823
278
279 Features
280 --------
281
282 - Python 3.6 compatibility.
283   https://github.com/Pylons/pyramid/issues/2835
284
285 - ``pcreate`` learned about ``--package-name`` to allow you to create a new
286   project in an existing folder with a different package name than the project
287   name. See https://github.com/Pylons/pyramid/pull/2783
288
289 - The ``_get_credentials`` private method of ``BasicAuthAuthenticationPolicy``
290   has been extracted into standalone function ``extract_http_basic_credentials``
291   in ``pyramid.authentication`` module, this function extracts HTTP Basic
292   credentials from a ``request`` object, and returns them as a named tuple.
293   See https://github.com/Pylons/pyramid/pull/2662
294
295 - Pyramid 1.4 silently dropped a feature of the configurator that has been
296   restored. It's again possible for action discriminators to conflict across
297   different action orders.
298   See https://github.com/Pylons/pyramid/pull/2757
299
300 - ``pyramid.paster.bootstrap`` and its sibling ``pyramid.scripting.prepare``
301   can now be used as context managers to automatically invoke the ``closer``
302   and pop threadlocals off of the stack to prevent memory leaks.
303   See https://github.com/Pylons/pyramid/pull/2760
304
305 - Added ``pyramid.config.Configurator.add_exception_view`` and the
306   ``pyramid.view.exception_view_config`` decorator. It is now possible using
307   these methods or via the new ``exception_only=True`` option to ``add_view``
308   to add a view which will only be matched when handling an exception.
309   Previously any exception views were also registered for a traversal
310   context that inherited from the exception class which prevented any
311   exception-only optimizations.
312   See https://github.com/Pylons/pyramid/pull/2660
313
314 - Added the ``exception_only`` boolean to
315   ``pyramid.interfaces.IViewDeriverInfo`` which can be used by view derivers
316   to determine if they are wrapping a view which only handles exceptions.
317   This means that it is no longer necessary to perform request-time checks
318   for ``request.exception`` to determine if the view is handling an exception
319   - the pipeline can be optimized at config-time.
320   See https://github.com/Pylons/pyramid/pull/2660
321
322 - ``pserve`` should now work with ``gevent`` and other workers that need
323   to monkeypatch the process, assuming the server and / or the app do so
324   as soon as possible before importing the rest of pyramid.
325   See https://github.com/Pylons/pyramid/pull/2797
326
327 - Pyramid no longer copies the settings object passed to the
328   ``pyramid.config.Configurator(settings=)``. The original ``dict`` is kept.
329   See https://github.com/Pylons/pyramid/pull/2823
330
331 - The csrf trusted origins setting may now be a whitespace-separated list of
332   domains. Previously only a python list was allowed. Also, it can now be set
333   using the ``PYRAMID_CSRF_TRUSTED_ORIGINS`` environment variable similar to
334   other settings. See https://github.com/Pylons/pyramid/pull/2823
335
336 - ``pserve --reload`` now uses the
337   `hupper <http://docs.pylonsproject.org/projects/hupper/en/latest/>`
338   library to monitor file changes. This comes with many improvements:
339
340   - If the `watchdog <http://pythonhosted.org/watchdog/>`_ package is
341     installed then monitoring will be done using inotify instead of
342     cpu and disk-intensive polling.
343
344   - The monitor is now a separate process that will not crash and starts up
345     before any of your code.
346
347   - The monitor will not restart the process after a crash until a file is
348     saved.
349
350   - The monitor works on windows.
351
352   - You can now trigger a reload manually from a pyramid view or any other
353     code via ``hupper.get_reloader().trigger_reload()``. Kind of neat.
354
355   - You can trigger a reload by issuing a ``SIGHUP`` to the monitor process.
356
357   See https://github.com/Pylons/pyramid/pull/2805
358
359 - A new ``[pserve]`` section is supported in your config files with a
360   ``watch_files`` key that can configure ``pserve --reload`` to monitor custom
361   file paths. See https://github.com/Pylons/pyramid/pull/2827
362
363 - Allow streaming responses to be made from subclasses of
364   ``pyramid.httpexceptions.HTTPException``. Previously the response would
365   be unrolled while testing for a body, making it impossible to stream
366   a response.
367   See https://github.com/Pylons/pyramid/pull/2863
368
369 - Update starter, alchemy and zodb scaffolds to support IPv6 by using the
370   new ``listen`` directives in waitress.
371   See https://github.com/Pylons/pyramid/pull/2853
372
373 - All p* scripts now use argparse instead of optparse. This improves their
374   ``--help`` output as well as enabling nicer documentation of their options.
375   See https://github.com/Pylons/pyramid/pull/2864
376
377 - Any deferred configuration action registered via ``config.action`` may now
378   depend on threadlocal state, such as asset overrides, being active when
379   the action is executed.
380   See https://github.com/Pylons/pyramid/pull/2873
381
382 - Asset specifications for directories passed to
383   ``config.add_translation_dirs`` now support overriding the entire asset
384   specification, including the folder name. Previously only the package name
385   was supported and the folder would always need to have the same name.
386   See https://github.com/Pylons/pyramid/pull/2873
387
388 - ``config.begin()`` will propagate the current threadlocal request through
389   as long as the registry is the same. For example:
390
391   .. code-block:: python
392
393      request = Request.blank(...)
394      config.begin(request)  # pushes a request
395      config.begin()         # propagates the previous request through unchanged
396      assert get_current_request() is request
397
398   See https://github.com/Pylons/pyramid/pull/2873
399
66585f 400 - Added a new ``callback`` option to ``config.set_default_csrf_options`` which
MM 401   can be used to determine per-request whether CSRF checking should be enabled
402   to allow for a mix authentication methods. Only cookie-based methods
403   generally require CSRF checking.
404   See https://github.com/Pylons/pyramid/pull/2778
405
b38bbf 406 Bug Fixes
MM 407 ---------
408
409 - Fixed bug in ``proutes`` such that it now shows the correct view when a
410   class and ``attr`` is involved.
411   See: https://github.com/Pylons/pyramid/pull/2687
412
413 - Fix a ``FutureWarning`` in Python 3.5 when using ``re.split`` on the
414   ``format`` setting to the ``proutes`` script.
415   See https://github.com/Pylons/pyramid/pull/2714
416
417 - Fix a ``RuntimeWarning`` emitted by WebOb when using arbitrary objects
418   as the ``userid`` in the ``AuthTktAuthenticationPolicy``. This is now caught
419   by the policy and the object is serialized as a base64 string to avoid
420   the cryptic warning. Since the userid will be read back as a string on
421   subsequent requests a more useful warning is emitted encouraging you to
422   use a primitive type instead.
423   See https://github.com/Pylons/pyramid/pull/2715
424
425 - Pyramid 1.6 introduced the ability for an action to invoke another action.
426   There was a bug in the way that ``config.add_view`` would interact with
427   custom view derivers introduced in Pyramid 1.7 because the view's
428   discriminator cannot be computed until view derivers and view predicates
429   have been created in earlier orders. Invoking an action from another action
430   would trigger an unrolling of the pipeline and would compute discriminators
431   before they were ready. The new behavior respects the ``order`` of the action
432   and ensures the discriminators are not computed until dependent actions
433   from previous orders have executed.
434   See https://github.com/Pylons/pyramid/pull/2757
435
436 - Fix bug in i18n where the default domain would always use the Germanic plural
437   style, even if a different plural function is defined in the relevant
438   messages file. See https://github.com/Pylons/pyramid/pull/2859
439
440 - The ``config.override_asset`` method now occurs during
441   ``pyramid.config.PHASE1_CONFIG`` such that it is ordered to execute before
442   any calls to ``config.add_translation_dirs``.
443   See https://github.com/Pylons/pyramid/pull/2873
444
445 Deprecations
446 ------------
447
448 - The ``pcreate`` script and related scaffolds have been deprecated in favor
449   of the popular
450   `cookiecutter <https://cookiecutter.readthedocs.io/en/latest/>`_ project.
451
452   All of Pyramid's official scaffolds as well as the tutorials have been
453   ported to cookiecutters:
454
455   - `pyramid-cookiecutter-starter
456     <https://github.com/Pylons/pyramid-cookiecutter-starter>`_
457
458   - `pyramid-cookiecutter-alchemy
459     <https://github.com/Pylons/pyramid-cookiecutter-alchemy>`_
460
461   - `pyramid-cookiecutter-zodb
462     <https://github.com/Pylons/pyramid-cookiecutter-zodb>`_
463
464   See https://github.com/Pylons/pyramid/pull/2780
465
466 Documentation Changes
467 ---------------------
468
469 - Update Typographical Conventions.
470   https://github.com/Pylons/pyramid/pull/2838
471
472 - Add `pyramid_nacl_session
473   <http://docs.pylonsproject.org/projects/pyramid-nacl-session/en/latest/>`_
474   to session factories. See https://github.com/Pylons/pyramid/issues/2791
475
476 - Update ``HACKING.txt`` from stale branch that was never merged to master.
477   See https://github.com/Pylons/pyramid/pull/2782
478
479 - Updated Windows installation instructions and related bits.
480   See https://github.com/Pylons/pyramid/issues/2661
481
482 - Fix an inconsistency in the documentation between view predicates and
483   route predicates and highlight the differences in their APIs.
484   See https://github.com/Pylons/pyramid/pull/2764
485
486 - Clarify a possible misuse of the ``headers`` kwarg to subclasses of
487   ``pyramid.httpexceptions.HTTPException`` in which more appropriate
488   kwargs from the parent class ``pyramid.response.Response`` should be
489   used instead. See https://github.com/Pylons/pyramid/pull/2750
490
491 - The SQLAlchemy + URL Dispatch + Jinja2 (``wiki2``) and
492   ZODB + Traversal + Chameleon (``wiki``) tutorials have been updated to
493   utilize the new cookiecutters and drop support for the ``pcreate``
494   scaffolds.
495
496   See https://github.com/Pylons/pyramid/pull/2881 and
497   https://github.com/Pylons/pyramid/pull/2883.
498
499 - Improve output of p* script descriptions for help.
500   See https://github.com/Pylons/pyramid/pull/2886
501
502 - Quick Tour updated to use cookiecutters instead of pcreate and scaffolds.
503   See https://github.com/Pylons/pyramid/pull/2888
504
f038c7 505 1.7 (2016-05-19)
MM 506 ================
507
508 - Fix a bug in the wiki2 tutorial where bcrypt is always expecting byte
509   strings. See https://github.com/Pylons/pyramid/pull/2576
510
511 - Simplify windows detection code and remove some duplicated data.
512   See https://github.com/Pylons/pyramid/pull/2585 and
513   https://github.com/Pylons/pyramid/pull/2586
514
515 1.7b4 (2016-05-12)
516 ==================
517
518 - Fixed the exception view tween to re-raise the original exception if
519   no exception view could be found to handle the exception. This better
520   allows tweens further up the chain to handle exceptions that were
521   left unhandled. Previously they would be converted into a
522   ``PredicateMismatch`` exception if predicates failed to allow the view to
523   handle the exception.
524   See https://github.com/Pylons/pyramid/pull/2567
525
526 - Exposed the ``pyramid.interfaces.IRequestFactory`` interface to mirror
527   the public ``pyramid.interfaces.IResponseFactory`` interface.
528
529 1.7b3 (2016-05-10)
530 ==================
531
532 - Fix ``request.invoke_exception_view`` to raise an ``HTTPNotFound``
533   exception if no view is matched. Previously ``None`` would be returned
534   if no views were matched and a ``PredicateMismatch`` would be raised if
535   a view "almost" matched (a view was found matching the context).
536   See https://github.com/Pylons/pyramid/pull/2564
537
538 - Add defaults for py.test configuration and coverage to all three scaffolds,
539   and update documentation accordingly.
540   See https://github.com/Pylons/pyramid/pull/2550
541
542 - Add ``linkcheck`` to ``Makefile`` for Sphinx. To check the documentation for
543   broken links, use the command ``make linkcheck
544   SPHINXBUILD=$VENV/bin/sphinx-build``. Also removed and fixed dozens of broken
545   external links.
546
547 - Fix the internal runner for scaffold tests to ensure they work with pip
548   and py.test.
549   See https://github.com/Pylons/pyramid/pull/2565
550
551 1.7b2 (2016-05-01)
552 ==================
553
554 - Removed inclusion of pyramid_tm in development.ini for alchemy scaffold
555   See https://github.com/Pylons/pyramid/issues/2538
556
557 - A default permission set via ``config.set_default_permission`` will no
558   longer be enforced on an exception view. This has been the case for a while
559   with the default exception views (``config.add_notfound_view`` and
560   ``config.add_forbidden_view``), however for any other exception view a
561   developer had to remember to set ``permission=NO_PERMISSION_REQUIRED`` or
562   be surprised when things didn't work. It is still possible to force a
563   permission check on an exception view by setting the ``permission`` argument
564   manually to ``config.add_view``. This behavior is consistent with the new
565   CSRF features added in the 1.7 series.
566   See https://github.com/Pylons/pyramid/pull/2534
567
568 1.7b1 (2016-04-25)
569 ==================
570
571 - This release announces the beta period for 1.7.
572
573 - Fix an issue where some files were being included in the alchemy scafffold
574   which had been removed from the 1.7 series.
575   See https://github.com/Pylons/pyramid/issues/2525
576
577 1.7a2 (2016-04-19)
578 ==================
579
580 Features
581 --------
582
583 - Automatic CSRF checks are now disabled by default on exception views. They
584   can be turned back on by setting the appropriate `require_csrf` option on
585   the view.
586   See https://github.com/Pylons/pyramid/pull/2517
587
588 - The automatic CSRF API was reworked to use a config directive for
589   setting the options. The ``pyramid.require_default_csrf`` setting is
590   no longer supported. Instead, a new ``config.set_default_csrf_options``
591   directive has been introduced that allows the developer to specify
592   the default value for ``require_csrf`` as well as change the CSRF token,
593   header and safe request methods. The ``pyramid.csrf_trusted_origins``
594   setting is still supported.
595   See https://github.com/Pylons/pyramid/pull/2518
596
597 Bug fixes
598 ---------
599
600 - CSRF origin checks had a bug causing the checks to always fail.
601   See https://github.com/Pylons/pyramid/pull/2512
602
603 - Fix the test suite to pass on windows.
604   See https://github.com/Pylons/pyramid/pull/2520
605
d9c20d 606 1.7a1 (2016-04-16)
MM 607 ==================
608
609 Backward Incompatibilities
610 --------------------------
611
612 - Following the Pyramid deprecation period (1.4 -> 1.6),
613   AuthTktAuthenticationPolicy's default hashing algorithm is changing from md5
614   to sha512. If you are using the authentication policy and need to continue
615   using md5, please explicitly set hashalg to 'md5'.
616
617   This change does mean that any existing auth tickets (and associated cookies)
618   will no longer be valid, and users will no longer be logged in, and have to
619   login to their accounts again.
620
621   See https://github.com/Pylons/pyramid/pull/2496
622
623 - The ``check_csrf_token`` function no longer validates a csrf token in the
624   query string of a request. Only headers and request bodies are supported.
625   See https://github.com/Pylons/pyramid/pull/2500
626
627 Features
628 --------
629
630 - Added a new setting, ``pyramid.require_default_csrf`` which may be used
631   to turn on CSRF checks globally for every POST request in the application.
632   This should be considered a good default for websites built on Pyramid.
633   It is possible to opt-out of CSRF checks on a per-view basis by setting
634   ``require_csrf=False`` on those views.
635   See https://github.com/Pylons/pyramid/pull/2413
636
637 - Added a ``require_csrf`` view option which will enforce CSRF checks on any
638   request with an unsafe method as defined by RFC2616. If the CSRF check fails
639   a ``BadCSRFToken`` exception will be raised and may be caught by exception
640   views (the default response is a ``400 Bad Request``). This option should be
641   used in place of the deprecated ``check_csrf`` view predicate which would
642   normally result in unexpected ``404 Not Found`` response to the client
643   instead of a catchable exception.  See
644   https://github.com/Pylons/pyramid/pull/2413 and
645   https://github.com/Pylons/pyramid/pull/2500
646
647 - Added an additional CSRF validation that checks the origin/referrer of a
648   request and makes sure it matches the current ``request.domain``. This
649   particular check is only active when accessing a site over HTTPS as otherwise
650   browsers don't always send the required information. If this additional CSRF
651   validation fails a ``BadCSRFOrigin`` exception will be raised and may be
652   caught by exception views (the default response is ``400 Bad Request``).
653   Additional allowed origins may be configured by setting
654   ``pyramid.csrf_trusted_origins`` to a list of domain names (with ports if on
655   a non standard port) to allow. Subdomains are not allowed unless the domain
656   name has been prefixed with a ``.``. See
657   https://github.com/Pylons/pyramid/pull/2501
658
659 - Added a new ``pyramid.session.check_csrf_origin`` API for validating the
660   origin or referrer headers against the request's domain.
661   See https://github.com/Pylons/pyramid/pull/2501
662
663 - Pyramid HTTPExceptions will now take into account the best match for the
664   clients Accept header, and depending on what is requested will return
665   text/html, application/json or text/plain. The default for */* is still
666   text/html, but if application/json is explicitly mentioned it will now
667   receive a valid JSON response. See
668   https://github.com/Pylons/pyramid/pull/2489
669
670 - A new event and interface (BeforeTraversal) has been introduced that will
671   notify listeners before traversal starts in the router. See
672   https://github.com/Pylons/pyramid/pull/2469 and
673   https://github.com/Pylons/pyramid/pull/1876
674
675 - Add a new "view deriver" concept to Pyramid to allow framework authors to
676   inject elements into the standard Pyramid view pipeline and affect all
677   views in an application. This is similar to a decorator except that it
678   has access to options passed to ``config.add_view`` and can affect other
679   stages of the pipeline such as the raw response from a view or prior to
680   security checks. See https://github.com/Pylons/pyramid/pull/2021
681
682 - Allow a leading ``=`` on the key of the request param predicate.
683   For example, '=abc=1' is equivalent down to
684   ``request.params['=abc'] == '1'``.
685   See https://github.com/Pylons/pyramid/pull/1370
686
687 - A new ``request.invoke_exception_view(...)`` method which can be used to
688   invoke an exception view and get back a response. This is useful for
689   rendering an exception view outside of the context of the excview tween
690   where you may need more control over the request.
691   See https://github.com/Pylons/pyramid/pull/2393
692
693 - Allow using variable substitutions like ``%(LOGGING_LOGGER_ROOT_LEVEL)s``
694   for logging sections of the .ini file and populate these variables from
695   the ``pserve`` command line -- e.g.:
696   ``pserve development.ini LOGGING_LOGGER_ROOT_LEVEL=DEBUG``
697   See https://github.com/Pylons/pyramid/pull/2399
698
699 Documentation Changes
700 ---------------------
701
702 - A complete overhaul of the docs:
703
704   - Use pip instead of easy_install.
705   - Become opinionated by preferring Python 3.4 or greater to simplify
706     installation of Python and its required packaging tools.
707   - Use venv for the tool, and virtual environment for the thing created,
708     instead of virtualenv.
709   - Use py.test and pytest-cov instead of nose and coverage.
710   - Further updates to the scaffolds as well as tutorials and their src files.
711
712   See https://github.com/Pylons/pyramid/pull/2468
713
714 - A complete overhaul of the ``alchemy`` scaffold as well as the
715   Wiki2 SQLAlchemy + URLDispatch tutorial to introduce more modern features
716   into the usage of SQLAlchemy with Pyramid and provide a better starting
717   point for new projects.
718   See https://github.com/Pylons/pyramid/pull/2024
719
720 Bug Fixes
721 ---------
722
723 - Fix ``pserve --browser`` to use the ``--server-name`` instead of the
724   app name when selecting a section to use. This was only working for people
725   who had server and app sections with the same name, for example
726   ``[app:main]`` and ``[server:main]``.
727   See https://github.com/Pylons/pyramid/pull/2292
728
729 Deprecations
730 ------------
731
732 - The ``check_csrf`` view predicate has been deprecated. Use the
733   new ``require_csrf`` option or the ``pyramid.require_default_csrf`` setting
734   to ensure that the ``BadCSRFToken`` exception is raised.
735   See https://github.com/Pylons/pyramid/pull/2413
736
737 - Support for Python 3.3 will be removed in Pyramid 1.8.
738   https://github.com/Pylons/pyramid/issues/2477
739
740 - Python 2.6 is no longer supported by Pyramid. See
741   https://github.com/Pylons/pyramid/issues/2368
742
743 - Dropped Python 3.2 support.
744   See https://github.com/Pylons/pyramid/pull/2256
745
53356f 746 1.6 (2016-01-03)
MM 747 ================
748
749 Deprecations
750 ------------
751
752 - Continue removal of ``pserve`` daemon/process management features
753   by deprecating ``--user`` and ``--group`` options.
754   See https://github.com/Pylons/pyramid/pull/2190
755
756 1.6b3 (2015-12-17)
757 ==================
758
759 Backward Incompatibilities
760 --------------------------
761
762 - Remove the ``cachebust`` option from ``config.add_static_view``. See
763   ``config.add_cache_buster`` for the new way to attach cache busters to
764   static assets.
765   See https://github.com/Pylons/pyramid/pull/2186
766
767 - Modify the ``pyramid.interfaces.ICacheBuster`` API to be a simple callable
768   instead of an object with ``match`` and ``pregenerate`` methods. Cache
769   busters are now focused solely on generation. Matching has been dropped.
770
771   Note this affects usage of ``pyramid.static.QueryStringCacheBuster`` and
772   ``pyramid.static.ManifestCacheBuster``.
773
774   See https://github.com/Pylons/pyramid/pull/2186
775
776 Features
777 --------
778
779 - Add a new ``config.add_cache_buster`` API for attaching cache busters to
780   static assets. See https://github.com/Pylons/pyramid/pull/2186
781
782 Bug Fixes
783 ---------
784
785 - Ensure that ``IAssetDescriptor.abspath`` always returns an absolute path.
786   There were cases depending on the process CWD that a relative path would
787   be returned. See https://github.com/Pylons/pyramid/issues/2188
788
789 1.6b2 (2015-10-15)
790 ==================
791
792 Features
793 --------
794
795 - Allow asset specifications to be supplied to
796   ``pyramid.static.ManifestCacheBuster`` instead of requiring a
797   filesystem path.
798
799 1.6b1 (2015-10-15)
800 ==================
801
802 Backward Incompatibilities
803 --------------------------
804
805 - IPython and BPython support have been removed from pshell in the core.
806   To continue using them on Pyramid 1.6+ you must install the binding
807   packages explicitly::
808
809     $ pip install pyramid_ipython
810
811     or
812
813     $ pip install pyramid_bpython
814
815 - Remove default cache busters introduced in 1.6a1 including
816   ``PathSegmentCacheBuster``, ``PathSegmentMd5CacheBuster``, and
817   ``QueryStringMd5CacheBuster``.
818   See https://github.com/Pylons/pyramid/pull/2116
819
820 Features
821 --------
822
823 - Additional shells for ``pshell`` can now be registered as entrypoints. See
824   https://github.com/Pylons/pyramid/pull/1891 and
825   https://github.com/Pylons/pyramid/pull/2012
826
827 - The variables injected into ``pshell`` are now displayed with their
828   docstrings instead of the default ``str(obj)`` when possible.
829   See https://github.com/Pylons/pyramid/pull/1929
830
831 - Add new ``pyramid.static.ManifestCacheBuster`` for use with external
832   asset pipelines as well as examples of common usages in the narrative.
833   See https://github.com/Pylons/pyramid/pull/2116
834
835 - Fix ``pserve --reload`` to not crash on syntax errors!!!
836   See https://github.com/Pylons/pyramid/pull/2125
837
838 - Fix an issue when user passes unparsed strings to ``pyramid.session.CookieSession``
839   and ``pyramid.authentication.AuthTktCookieHelper`` for time related parameters
840   ``timeout``, ``reissue_time``, ``max_age`` that expect an integer value.
841   See https://github.com/Pylons/pyramid/pull/2050
842
843 Bug Fixes
844 ---------
845
846 - ``pyramid.httpexceptions.HTTPException`` now defaults to
847   ``520 Unknown Error`` instead of ``None None`` to conform with changes in
848   WebOb 1.5.
849   See https://github.com/Pylons/pyramid/pull/1865
850
851 - ``pshell`` will now preserve the capitalization of variables in the
852   ``[pshell]`` section of the INI file. This makes exposing classes to the
853   shell a little more straightfoward.
854   See https://github.com/Pylons/pyramid/pull/1883
855
856 - Fixed usage of ``pserve --monitor-restart --daemon`` which would fail in
857   horrible ways. See https://github.com/Pylons/pyramid/pull/2118
858
859 - Explicitly prevent ``pserve --reload --daemon`` from being used. It's never
860   been supported but would work and fail in weird ways.
861   See https://github.com/Pylons/pyramid/pull/2119
862
863 - Fix an issue on Windows when running ``pserve --reload`` in which the
864   process failed to fork because it could not find the pserve script to
865   run. See https://github.com/Pylons/pyramid/pull/2138
866
867 Deprecations
868 ------------
869
870 - Deprecate ``pserve --monitor-restart`` in favor of user's using a real
871   process manager such as Systemd or Upstart as well as Python-based
872   solutions like Circus and Supervisor.
873   See https://github.com/Pylons/pyramid/pull/2120
874
875 1.6a2 (2015-06-30)
876 ==================
877
878 Bug Fixes
879 ---------
880
881 - Ensure that ``pyramid.httpexceptions.exception_response`` returns the
882   appropriate "concrete" class for ``400`` and ``500`` status codes.
883   See https://github.com/Pylons/pyramid/issues/1832
884
885 - Fix an infinite recursion bug introduced in 1.6a1 when
886   ``pyramid.view.render_view_to_response`` was called directly or indirectly.
887   See https://github.com/Pylons/pyramid/issues/1643
888
889 - Further fix the JSONP renderer by prefixing the returned content with
890   a comment. This should mitigate attacks from Flash (See CVE-2014-4671).
891   See https://github.com/Pylons/pyramid/pull/1649
892
893 - Allow periods and brackets (``[]``) in the JSONP callback. The original
894   fix was overly-restrictive and broke Angular.
895   See https://github.com/Pylons/pyramid/pull/1649
896
897 1.6a1 (2015-04-15)
898 ==================
899
900 Features
901 --------
902
903 - pcreate will now ask for confirmation if invoked with
904   an argument for a project name that already exists or
905   is importable in the current environment.
906   See https://github.com/Pylons/pyramid/issues/1357 and
907   https://github.com/Pylons/pyramid/pull/1837
908
909 - Make it possible to subclass ``pyramid.request.Request`` and also use
910   ``pyramid.request.Request.add_request.method``.  See
911   https://github.com/Pylons/pyramid/issues/1529
912
913 - The ``pyramid.config.Configurator`` has grown the ability to allow
914   actions to call other actions during a commit-cycle. This enables much more
915   logic to be placed into actions, such as the ability to invoke other actions
916   or group them for improved conflict detection. We have also exposed and
917   documented the config phases that Pyramid uses in order to further assist
918   in building conforming addons.
919   See https://github.com/Pylons/pyramid/pull/1513
920
921 - Add ``pyramid.request.apply_request_extensions`` function which can be
922   used in testing to apply any request extensions configured via
923   ``config.add_request_method``. Previously it was only possible to test
924   the extensions by going through Pyramid's router.
925   See https://github.com/Pylons/pyramid/pull/1581
926
927 - pcreate when run without a scaffold argument will now print information on
928   the missing flag, as well as a list of available scaffolds.
929   See https://github.com/Pylons/pyramid/pull/1566 and
930   https://github.com/Pylons/pyramid/issues/1297
931
932 - Added support / testing for 'pypy3' under Tox and Travis.
933   See https://github.com/Pylons/pyramid/pull/1469
934
935 - Automate code coverage metrics across py2 and py3 instead of just py2.
936   See https://github.com/Pylons/pyramid/pull/1471
937
938 - Cache busting for static resources has been added and is available via a new
939   argument to ``pyramid.config.Configurator.add_static_view``: ``cachebust``.
940   Core APIs are shipped for both cache busting via query strings and
941   path segments and may be extended to fit into custom asset pipelines.
942   See https://github.com/Pylons/pyramid/pull/1380 and
943   https://github.com/Pylons/pyramid/pull/1583
944
945 - Add ``pyramid.config.Configurator.root_package`` attribute and init
946   parameter to assist with includeable packages that wish to resolve
947   resources relative to the package in which the ``Configurator`` was created.
948   This is especially useful for addons that need to load asset specs from
949   settings, in which case it is may be natural for a developer to define
950   imports or assets relative to the top-level package.
951   See https://github.com/Pylons/pyramid/pull/1337
952
953 - Added line numbers to the log formatters in the scaffolds to assist with
954   debugging. See https://github.com/Pylons/pyramid/pull/1326
955
956 - Add new HTTP exception objects for status codes
957   ``428 Precondition Required``, ``429 Too Many Requests`` and
958   ``431 Request Header Fields Too Large`` in ``pyramid.httpexceptions``.
959   See https://github.com/Pylons/pyramid/pull/1372/files
960
961 - The ``pshell`` script will now load a ``PYTHONSTARTUP`` file if one is
962   defined in the environment prior to launching the interpreter.
963   See https://github.com/Pylons/pyramid/pull/1448
964
965 - Make it simple to define notfound and forbidden views that wish to use
966   the default exception-response view but with altered predicates and other
967   configuration options. The ``view`` argument is now optional in
968   ``config.add_notfound_view`` and ``config.add_forbidden_view``..
969   See https://github.com/Pylons/pyramid/issues/494
970
971 - Greatly improve the readability of the ``pcreate`` shell script output.
972   See https://github.com/Pylons/pyramid/pull/1453
973
974 - Improve robustness to timing attacks in the ``AuthTktCookieHelper`` and
975   the ``SignedCookieSessionFactory`` classes by using the stdlib's
976   ``hmac.compare_digest`` if it is available (such as Python 2.7.7+ and 3.3+).
977   See https://github.com/Pylons/pyramid/pull/1457
978
979 - Assets can now be overidden by an absolute path on the filesystem when using
980   the ``config.override_asset`` API. This makes it possible to fully support
981   serving up static content from a mutable directory while still being able
982   to use the ``request.static_url`` API and ``config.add_static_view``.
983   Previously it was not possible to use ``config.add_static_view`` with an
984   absolute path **and** generate urls to the content. This change replaces
985   the call, ``config.add_static_view('/abs/path', 'static')``, with
986   ``config.add_static_view('myapp:static', 'static')`` and
987   ``config.override_asset(to_override='myapp:static/',
988   override_with='/abs/path/')``. The ``myapp:static`` asset spec is completely
989   made up and does not need to exist - it is used for generating urls
990   via ``request.static_url('myapp:static/foo.png')``.
991   See https://github.com/Pylons/pyramid/issues/1252
992
993 - Added ``pyramid.config.Configurator.set_response_factory`` and the
994   ``response_factory`` keyword argument to the ``Configurator`` for defining
995   a factory that will return a custom ``Response`` class.
996   See https://github.com/Pylons/pyramid/pull/1499
997
998 - Allow an iterator to be returned from a renderer. Previously it was only
999   possible to return bytes or unicode.
1000   See https://github.com/Pylons/pyramid/pull/1417
1001
1002 - ``pserve`` can now take a ``-b`` or ``--browser`` option to open the server
1003   URL in a web browser. See https://github.com/Pylons/pyramid/pull/1533
1004
1005 - Overall improvments for the ``proutes`` command. Added ``--format`` and
1006   ``--glob`` arguments to the command, introduced the ``method``
1007   column for displaying available request methods, and improved the ``view``
1008   output by showing the module instead of just ``__repr__``.
1009   See https://github.com/Pylons/pyramid/pull/1488
1010
1011 - Support keyword-only arguments and function annotations in views in
1012   Python 3. See https://github.com/Pylons/pyramid/pull/1556
1013
1014 - ``request.response`` will no longer be mutated when using the
1015   ``pyramid.renderers.render_to_response()`` API.  It is now necessary to
1016   pass in a ``response=`` argument to ``render_to_response`` if you wish to
1017   supply the renderer with a custom response object for it to use. If you
1018   do not pass one then a response object will be created using the
1019   application's ``IResponseFactory``. Almost all renderers
1020   mutate the ``request.response`` response object (for example, the JSON
1021   renderer sets ``request.response.content_type`` to ``application/json``).
1022   However, when invoking ``render_to_response`` it is not expected that the
1023   response object being returned would be the same one used later in the
1024   request. The response object returned from ``render_to_response`` is now
1025   explicitly different from ``request.response``. This does not change the
1026   API of a renderer. See https://github.com/Pylons/pyramid/pull/1563
1027
1028 - The ``append_slash`` argument of ```Configurator().add_notfound_view()`` will
1029   now accept anything that implements the ``IResponse`` interface and will use
1030   that as the response class instead of the default ``HTTPFound``.  See
1031   https://github.com/Pylons/pyramid/pull/1610
1032
1033 Bug Fixes
1034 ---------
1035
1036 - The JSONP renderer created JavaScript code in such a way that a callback
1037   variable could be used to arbitrarily inject javascript into the response
1038   object. https://github.com/Pylons/pyramid/pull/1627
1039
1040 - Work around an issue where ``pserve --reload`` would leave terminal echo
1041   disabled if it reloaded during a pdb session.
1042   See https://github.com/Pylons/pyramid/pull/1577,
1043   https://github.com/Pylons/pyramid/pull/1592
1044
1045 - ``pyramid.wsgi.wsgiapp`` and ``pyramid.wsgi.wsgiapp2`` now raise
1046   ``ValueError`` when accidentally passed ``None``.
1047   See https://github.com/Pylons/pyramid/pull/1320
1048
1049 - Fix an issue whereby predicates would be resolved as maybe_dotted in the
1050   introspectable but not when passed for registration. This would mean that
1051   ``add_route_predicate`` for example can not take a string and turn it into
1052   the actual callable function.
1053   See https://github.com/Pylons/pyramid/pull/1306
1054
1055 - Fix ``pyramid.testing.setUp`` to return a ``Configurator`` with a proper
1056   package. Previously it was not possible to do package-relative includes
1057   using the returned ``Configurator`` during testing. There is now a
1058   ``package`` argument that can override this behavior as well.
1059   See https://github.com/Pylons/pyramid/pull/1322
1060
1061 - Fix an issue where a ``pyramid.response.FileResponse`` may apply a charset
1062   where it does not belong. See https://github.com/Pylons/pyramid/pull/1251
1063
1064 - Work around a bug introduced in Python 2.7.7 on Windows where
1065   ``mimetypes.guess_type`` returns Unicode rather than str for the content
1066   type, unlike any previous version of Python.  See
1067   https://github.com/Pylons/pyramid/issues/1360 for more information.
1068
1069 - ``pcreate`` now normalizes the package name by converting hyphens to
1070   underscores. See https://github.com/Pylons/pyramid/pull/1376
1071
1072 - Fix an issue with the final response/finished callback being unable to
1073   add another callback to the list. See
1074   https://github.com/Pylons/pyramid/pull/1373
1075
1076 - Fix a failing unittest caused by differing mimetypes across various OSs.
1077   See https://github.com/Pylons/pyramid/issues/1405
1078
1079 - Fix route generation for static view asset specifications having no path.
1080   See https://github.com/Pylons/pyramid/pull/1377
1081
1082 - Allow the ``pyramid.renderers.JSONP`` renderer to work even if there is no
1083   valid request object. In this case it will not wrap the object in a
1084   callback and thus behave just like the ``pyramid.renderers.JSON`` renderer.
1085   See https://github.com/Pylons/pyramid/pull/1561
1086
1087 - Prevent "parameters to load are deprecated" ``DeprecationWarning``
1088   from setuptools>=11.3. See https://github.com/Pylons/pyramid/pull/1541
1089
1090 - Avoiding sharing the ``IRenderer`` objects across threads when attached to
1091   a view using the `renderer=` argument. These renderers were instantiated
1092   at time of first render and shared between requests, causing potentially
1093   subtle effects like `pyramid.reload_templates = true` failing to work
1094   in `pyramid_mako`. See https://github.com/Pylons/pyramid/pull/1575
1095   and https://github.com/Pylons/pyramid/issues/1268
1096
1097 - Avoiding timing attacks against CSRF tokens.
1098   See https://github.com/Pylons/pyramid/pull/1574
1099
1100 - ``request.finished_callbacks`` and ``request.response_callbacks`` now
1101   default to an iterable instead of ``None``. It may be checked for a length
1102   of 0. This was the behavior in 1.5.
1103
1104 Deprecations
1105 ------------
1106
1107 - The ``pserve`` command's daemonization features have been deprecated. This
1108   includes the ``[start,stop,restart,status]`` subcommands as well as the
1109   ``--daemon``, ``--stop-server``, ``--pid-file``, and ``--status`` flags.
1110
1111   Please use a real process manager in the future instead of relying on the
1112   ``pserve`` to daemonize itself. Many options exist including your Operating
1113   System's services such as Systemd or Upstart, as well as Python-based
1114   solutions like Circus and Supervisor.
1115
1116   See https://github.com/Pylons/pyramid/pull/1641
1117
1118 - Renamed the ``principal`` argument to ``pyramid.security.remember()`` to
1119   ``userid`` in order to clarify its intended purpose.
1120   See https://github.com/Pylons/pyramid/pull/1399
1121
1122 Docs
1123 ----
1124
1125 - Moved the documentation for ``accept`` on ``Configurator.add_view`` to no
1126   longer be part of the predicate list. See
1127   https://github.com/Pylons/pyramid/issues/1391 for a bug report stating
1128   ``not_`` was failing on ``accept``. Discussion with @mcdonc led to the
1129   conclusion that it should not be documented as a predicate.
1130   See https://github.com/Pylons/pyramid/pull/1487 for this PR
1131
1132 - Removed logging configuration from Quick Tutorial ini files except for
1133   scaffolding- and logging-related chapters to avoid needing to explain it too
1134   early.
1135
1136 - Clarify a previously-implied detail of the ``ISession.invalidate`` API
1137   documentation.
1138
1139 - Improve and clarify the documentation on what Pyramid defines as a
1140   ``principal`` and a ``userid`` in its security APIs.
1141   See https://github.com/Pylons/pyramid/pull/1399
1142
1143 - Add documentation of command line programs (``p*`` scripts). See
1144   https://github.com/Pylons/pyramid/pull/2191
1145
1146 Scaffolds
1147 ---------
1148
1149 - Update scaffold generating machinery to return the version of pyramid and
1150   pyramid docs for use in scaffolds. Updated starter, alchemy and zodb
1151   templates to have links to correctly versioned documentation and reflect
1152   which pyramid was used to generate the scaffold.
1153
1154 - Removed non-ascii copyright symbol from templates, as this was
1155   causing the scaffolds to fail for project generation.
1156
1157 - You can now run the scaffolding func tests via ``tox py2-scaffolds`` and
1158   ``tox py3-scaffolds``.
1159
1160
4b818c 1161 1.5 (2014-04-08)
CM 1162 ================
1163
169dba 1164 - Python 3.4 compatibility.
SP 1165
4b818c 1166 - Avoid crash in ``pserve --reload`` under Py3k, when iterating over possibly
CM 1167   mutated ``sys.modules``.
1168
1169 - ``UnencryptedCookieSessionFactoryConfig`` failed if the secret contained
1170   higher order characters. See https://github.com/Pylons/pyramid/issues/1246
1171
1172 - Fixed a bug in ``UnencryptedCookieSessionFactoryConfig`` and
1173   ``SignedCookieSessionFactory`` where ``timeout=None`` would cause a new
1174   session to always be created. Also in ``SignedCookieSessionFactory`` a
1175   ``reissue_time=None`` would cause an exception when modifying the session.
1176   See https://github.com/Pylons/pyramid/issues/1247
1177
1178 - Updated docs and scaffolds to keep in step with new 2.0 release of
1179   ``Lingua``.  This included removing all ``setup.cfg`` files from scaffolds
1180   and documentation environments.
1181
1182 1.5b1 (2014-02-08)
1183 ==================
1184
1185 Features
1186 --------
1187
1188 - We no longer eagerly clear ``request.exception`` and ``request.exc_info`` in
1189   the exception view tween.  This makes it possible to inspect exception
1190   information within a finished callback.  See
1191   https://github.com/Pylons/pyramid/issues/1223.
1192
1193 1.5a4 (2014-01-28)
1194 ==================
1195
1196 Features
1197 --------
1198
1199 - Updated scaffolds with new theme, fixed documentation and sample project.
1200
1201 Bug Fixes
1202 ---------
1203
1204 - Depend on a newer version of WebOb so that we pull in some crucial bug-fixes
1205   that were showstoppers for functionality in Pyramid.
1206
1207 - Add a trailing semicolon to the JSONP response. This fixes JavaScript syntax
1208   errors for old IE versions. See https://github.com/Pylons/pyramid/pull/1205
1209
1210 - Fix a memory leak when the configurator's ``set_request_property`` method was
1211   used or when the configurator's ``add_request_method`` method was used with
1212   the ``property=True`` attribute.  See
1213   https://github.com/Pylons/pyramid/issues/1212 .
1214
1215 1.5a3 (2013-12-10)
1216 ==================
1217
1218 Features
1219 --------
1220
1221 - An authorization API has been added as a method of the
1222   request: ``request.has_permission``.
1223
1224   ``request.has_permission`` is a method-based alternative to the
1225   ``pyramid.security.has_permission`` API and works exactly the same.  The
1226   older API is now deprecated.
1227
1228 - Property API attributes have been added to the request for easier access to
1229   authentication data: ``request.authenticated_userid``,
1230   ``request.unauthenticated_userid``, and ``request.effective_principals``.
1231
1232   These are analogues, respectively, of
1233   ``pyramid.security.authenticated_userid``,
1234   ``pyramid.security.unauthenticated_userid``, and
1235   ``pyramid.security.effective_principals``.  They operate exactly the same,
1236   except they are attributes of the request instead of functions accepting a
1237   request.  They are properties, so they cannot be assigned to.  The older
1238   function-based APIs are now deprecated.
1239
1240 - Pyramid's console scripts (``pserve``, ``pviews``, etc) can now be run
1241   directly, allowing custom arguments to be sent to the python interpreter
1242   at runtime. For example::
1243
1244       python -3 -m pyramid.scripts.pserve development.ini
1245
1246 - Added a specific subclass of ``HTTPBadRequest`` named
1247   ``pyramid.exceptions.BadCSRFToken`` which will now be raised in response
1248   to failures in ``check_csrf_token``.
1249   See https://github.com/Pylons/pyramid/pull/1149
1250
1251 - Added a new ``SignedCookieSessionFactory`` which is very similar to the
1252   ``UnencryptedCookieSessionFactoryConfig`` but with a clearer focus on signing
1253   content. The custom serializer arguments to this function should only focus
1254   on serializing, unlike its predecessor which required the serializer to also
1255   perform signing.  See https://github.com/Pylons/pyramid/pull/1142 .  Note
1256   that cookies generated using ``SignedCookieSessionFactory`` are not
1257   compatible with cookies generated using ``UnencryptedCookieSessionFactory``,
1258   so existing user session data will be destroyed if you switch to it.
1259
1260 - Added a new ``BaseCookieSessionFactory`` which acts as a generic cookie
1261   factory that can be used by framework implementors to create their own
1262   session implementations. It provides a reusable API which focuses strictly
1263   on providing a dictionary-like object that properly handles renewals,
1264   timeouts, and conformance with the ``ISession`` API.
1265   See https://github.com/Pylons/pyramid/pull/1142
1266
1267 - The anchor argument to ``pyramid.request.Request.route_url`` and
1268   ``pyramid.request.Request.resource_url`` and their derivatives will now be
1269   escaped via URL quoting to ensure minimal conformance.  See
1270   https://github.com/Pylons/pyramid/pull/1183
1271
1272 - Allow sending of ``_query`` and ``_anchor`` options to
1273   ``pyramid.request.Request.static_url`` when an external URL is being
1274   generated.
1275   See https://github.com/Pylons/pyramid/pull/1183
1276
1277 - You can now send a string as the ``_query`` argument to
1278   ``pyramid.request.Request.route_url`` and
1279   ``pyramid.request.Request.resource_url`` and their derivatives.  When a
1280   string is sent instead of a list or dictionary. it is URL-quoted however it
1281   does not need to be in ``k=v`` form.  This is useful if you want to be able
1282   to use a different query string format than ``x-www-form-urlencoded``.  See
1283   https://github.com/Pylons/pyramid/pull/1183
1284
1285 - ``pyramid.testing.DummyRequest`` now has a ``domain`` attribute to match the
1286   new WebOb 1.3 API.  Its value is ``example.com``.
1287
1288 Bug Fixes
1289 ---------
1290
1291 - Fix the ``pcreate`` script so that when the target directory name ends with a
1292   slash it does not produce a non-working project directory structure.
1293   Previously saying ``pcreate -s starter /foo/bar/`` produced different output
1294   than  saying ``pcreate -s starter /foo/bar``.  The former did not work
1295   properly.
1296
1297 - Fix the ``principals_allowed_by_permission`` method of
1298   ``ACLAuthorizationPolicy`` so it anticipates a callable ``__acl__``
1299   on resources.  Previously it did not try to call the ``__acl__``
1300   if it was callable.
1301
1302 - The ``pviews`` script did not work when a url required custom request
1303   methods in order to perform traversal. Custom methods and descriptors added
1304   via ``pyramid.config.Configurator.add_request_method`` will now be present,
1305   allowing traversal to continue.
1306   See https://github.com/Pylons/pyramid/issues/1104
1307
1308 - Remove unused ``renderer`` argument from ``Configurator.add_route``.
1309
1310 - Allow the ``BasicAuthenticationPolicy`` to work with non-ascii usernames
1311   and passwords. The charset is not passed as part of the header and different
1312   browsers alternate between UTF-8 and Latin-1, so the policy now attempts
1313   to decode with UTF-8 first, and will fallback to Latin-1.
1314   See https://github.com/Pylons/pyramid/pull/1170
1315
1316 - The ``@view_defaults`` now apply to notfound and forbidden views
1317   that are defined as methods of a decorated class.
1318   See https://github.com/Pylons/pyramid/issues/1173
1319
1320 Documentation
1321 -------------
1322
1323 - Added a "Quick Tutorial" to go with the Quick Tour
1324
1325 - Removed mention of ``pyramid_beaker`` from docs.  Beaker is no longer
1326   maintained.  Point people at ``pyramid_redis_sessions`` instead.
1327
1328 - Add documentation for ``pyramid.interfaces.IRendererFactory`` and
1329   ``pyramid.interfaces.IRenderer``.
1330
1331 Backwards Incompatibilities
1332 ---------------------------
1333
1334 - The key/values in the ``_query`` parameter of ``request.route_url`` and the
1335   ``query`` parameter of ``request.resource_url`` (and their variants), used
1336   to encode a value of ``None`` as the string ``'None'``, leaving the resulting
1337   query string to be ``a=b&key=None``. The value is now dropped in this
1338   situation, leaving a query string of ``a=b&key=``.
1339   See https://github.com/Pylons/pyramid/issues/1119
1340
1341 Deprecations
1342 ------------
1343
1344 - Deprecate the ``pyramid.interfaces.ITemplateRenderer`` interface. It was
1345   ill-defined and became unused when Mako and Chameleon template bindings were
1346   split into their own packages.
1347
1348 - The ``pyramid.session.UnencryptedCookieSessionFactoryConfig`` API has been
1349   deprecated and is superseded by the
1350   ``pyramid.session.SignedCookieSessionFactory``.  Note that while the cookies
1351   generated by the ``UnencryptedCookieSessionFactoryConfig``
1352   are compatible with cookies generated by old releases, cookies generated by
1353   the SignedCookieSessionFactory are not. See
1354   https://github.com/Pylons/pyramid/pull/1142
1355
1356 - The ``pyramid.security.has_permission`` API is now deprecated.  Instead, use
1357   the newly-added ``has_permission`` method of the request object.
1358
1359 - The ``pyramid.security.effective_principals`` API is now deprecated.
1360   Instead, use the newly-added ``effective_principals`` attribute of the
1361   request object.
1362
1363 - The ``pyramid.security.authenticated_userid`` API is now deprecated.
1364   Instead, use the newly-added ``authenticated_userid`` attribute of the
1365   request object.
1366
1367 - The ``pyramid.security.unauthenticated_userid`` API is now deprecated.
1368   Instead, use the newly-added ``unauthenticated_userid`` attribute of the
1369   request object.
1370
1371 Dependencies
1372 ------------
1373
1374 - Pyramid now depends on WebOb>=1.3 (it uses ``webob.cookies.CookieProfile``
1375   from 1.3+).
1376
1377 1.5a2 (2013-09-22)
1378 ==================
1379
1380 Features
1381 --------
1382
1383 - Users can now provide dotted Python names to as the ``factory`` argument
1384   the Configurator methods named ``add_{view,route,subscriber}_predicate``
1385   (instead of passing the predicate factory directly, you can pass a
1386   dotted name which refers to the factory).
1387
1388 Bug Fixes
1389 ---------
1390
1391 - Fix an exception in ``pyramid.path.package_name`` when resolving the package
1392   name for namespace packages that had no ``__file__`` attribute.
1393
1394 Backwards Incompatibilities
1395 ---------------------------
1396
1397 - Pyramid no longer depends on or configures the Mako and Chameleon templating
1398   system renderers by default.  Disincluding these templating systems by
1399   default means that the Pyramid core has fewer dependencies and can run on
1400   future platforms without immediate concern for the compatibility of its
1401   templating add-ons.  It also makes maintenance slightly more effective, as
1402   different people can maintain the templating system add-ons that they
1403   understand and care about without needing commit access to the Pyramid core,
1404   and it allows users who just don't want to see any packages they don't use
1405   come along for the ride when they install Pyramid.
1406
1407   This means that upon upgrading to Pyramid 1.5a2+, projects that use either
1408   of these templating systems will see a traceback that ends something like
1409   this when their application attempts to render a Chameleon or Mako template::
1410
1411      ValueError: No such renderer factory .pt
1412
1413   Or::
1414
1415      ValueError: No such renderer factory .mako
1416
1417   Or::
1418
1419      ValueError: No such renderer factory .mak
1420
1421   Support for Mako templating has been moved into an add-on package named
1422   ``pyramid_mako``, and support for Chameleon templating has been moved into
1423   an add-on package named ``pyramid_chameleon``.  These packages are drop-in
1424   replacements for the old built-in support for these templating langauges.
1425   All you have to do is install them and make them active in your configuration
1426   to register renderer factories for ``.pt`` and/or ``.mako`` (or ``.mak``) to
1427   make your application work again.
1428
1429   To re-add support for Chameleon and/or Mako template renderers into your
1430   existing projects, follow the below steps.
1431
1432   If you depend on Mako templates:
1433
1434   * Make sure the ``pyramid_mako`` package is installed.  One way to do this
1435     is by adding ``pyramid_mako`` to the ``install_requires`` section of your
1436     package's ``setup.py`` file and afterwards rerunning ``setup.py develop``::
1437
1438         setup(
1439             #...
1440             install_requires=[
1441                 'pyramid_mako',         # new dependency
1442                 'pyramid',
1443                 #...
1444             ],
1445         )
1446
1447   * Within the portion of your application which instantiates a Pyramid
1448     ``pyramid.config.Configurator`` (often the ``main()`` function in
1449     your project's ``__init__.py`` file), tell Pyramid to include the
1450     ``pyramid_mako`` includeme::
1451
1452         config = Configurator(.....)
1453         config.include('pyramid_mako')
1454
1455   If you depend on Chameleon templates:
1456
1457   * Make sure the ``pyramid_chameleon`` package is installed.  One way to do
1458     this is by adding ``pyramid_chameleon`` to the ``install_requires`` section
1459     of your package's ``setup.py`` file and afterwards rerunning
1460     ``setup.py develop``::
1461
1462         setup(
1463             #...
1464             install_requires=[
1465                 'pyramid_chameleon',         # new dependency
1466                 'pyramid',
1467                 #...
1468             ],
1469         )
1470
1471   * Within the portion of your application which instantiates a Pyramid
1472     ``~pyramid.config.Configurator`` (often the ``main()`` function in
1473     your project's ``__init__.py`` file), tell Pyramid to include the
1474     ``pyramid_chameleon`` includeme::
1475
1476         config = Configurator(.....)
1477         config.include('pyramid_chameleon')
1478
1479   Note that it's also fine to install these packages into *older* Pyramids for
1480   forward compatibility purposes.  Even if you don't upgrade to Pyramid 1.5
1481   immediately, performing the above steps in a Pyramid 1.4 installation is
1482   perfectly fine, won't cause any difference, and will give you forward
1483   compatibility when you eventually do upgrade to Pyramid 1.5.
1484
1485   With the removal of Mako and Chameleon support from the core, some
1486   unit tests that use the ``pyramid.renderers.render*`` methods may begin to
1487   fail.  If any of your unit tests are invoking either
1488   ``pyramid.renderers.render()``  or ``pyramid.renderers.render_to_response()``
1489   with either Mako or Chameleon templates then the
1490   ``pyramid.config.Configurator`` instance in effect during
1491   the unit test should be also be updated to include the addons, as shown
1492   above. For example::
1493
1494         class ATest(unittest.TestCase):
1495             def setUp(self):
1496                 self.config = pyramid.testing.setUp()
1497                 self.config.include('pyramid_mako')
1498
1499             def test_it(self):
1500                 result = pyramid.renderers.render('mypkg:templates/home.mako', {})
1501
1502   Or::
1503
1504         class ATest(unittest.TestCase):
1505             def setUp(self):
1506                 self.config = pyramid.testing.setUp()
1507                 self.config.include('pyramid_chameleon')
1508
1509             def test_it(self):
1510                 result = pyramid.renderers.render('mypkg:templates/home.pt', {})
1511
1512 - If you're using the Pyramid debug toolbar, when you upgrade Pyramid to
1513   1.5a2+, you'll also need to upgrade the ``pyramid_debugtoolbar`` package to
1514   at least version 1.0.8, as older toolbar versions are not compatible with
1515   Pyramid 1.5a2+ due to the removal of Mako support from the core.  It's
1516   fine to use this newer version of the toolbar code with older Pyramids too.
1517
1518 - Removed the ``request.response_*`` varying attributes. These attributes
1519   have been deprecated since Pyramid 1.1, and as per the deprecation policy,
1520   have now been removed.
1521
1522 - ``request.response`` will no longer be mutated when using the
1523   ``pyramid.renderers.render()`` API.  Almost all renderers mutate the
1524   ``request.response`` response object (for example, the JSON renderer sets
1525   ``request.response.content_type`` to ``application/json``), but this is
1526   only necessary when the renderer is generating a response; it was a bug
1527   when it was done as a side effect of calling ``pyramid.renderers.render()``.
1528
1529 - Removed the ``bfg2pyramid`` fixer script.
1530
1531 - The ``pyramid.events.NewResponse`` event is now sent **after** response
1532   callbacks are executed.  It previously executed before response callbacks
1533   were executed.  Rationale: it's more useful to be able to inspect the response
1534   after response callbacks have done their jobs instead of before.
1535
1536 - Removed the class named ``pyramid.view.static`` that had been deprecated
1537   since Pyramid 1.1.  Instead use ``pyramid.static.static_view`` with
1538   ``use_subpath=True`` argument.
1539
1540 - Removed the ``pyramid.view.is_response`` function that had been deprecated
1541   since Pyramid 1.1.  Use the ``pyramid.request.Request.is_response`` method
1542   instead.
1543
1544 - Removed the ability to pass the following arguments to
1545   ``pyramid.config.Configurator.add_route``: ``view``, ``view_context``.
1546   ``view_for``, ``view_permission``, ``view_renderer``, and ``view_attr``.
1547   Using these arguments had been deprecated since Pyramid 1.1.  Instead of
1548   passing view-related arguments to ``add_route``, use a separate call to
1549   ``pyramid.config.Configurator.add_view`` to associate a view with a route
1550   using its ``route_name`` argument.  Note that this impacts the
1551   ``pyramid.config.Configurator.add_static_view`` function too, because it
1552   delegates to ``add_route``.
1553
1554 - Removed the ability to influence and query a ``pyramid.request.Request``
1555   object as if it were a dictionary.  Previously it was possible to use methods
1556   like ``__getitem__``, ``get``, ``items``, and other dictlike methods to
1557   access values in the WSGI environment.  This behavior had been deprecated
1558   since Pyramid 1.1.  Use methods of ``request.environ`` (a real dictionary)
1559   instead.
1560
1561 - Removed ancient backwards compatibily hack in
1562   ``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of
1563   the factory with the matchdict values for compatibility with BFG 0.9.
1564
1565 - The ``renderer_globals_factory`` argument to the
1566   ``pyramid.config.Configurator` constructor and its ``setup_registry`` method
1567   has been removed.  The ``set_renderer_globals_factory`` method of
1568   ``pyramid.config.Configurator`` has also been removed.  The (internal)
1569   ``pyramid.interfaces.IRendererGlobals`` interface was also removed.  These
1570   arguments, methods and interfaces had been deprecated since 1.1.  Use a
1571   ``BeforeRender`` event subscriber as documented in the "Hooks" chapter of the
1572   Pyramid narrative documentation instead of providing renderer globals values
1573   to the configurator.
1574
1575 Deprecations
1576 ------------
1577
1578 - The ``pyramid.config.Configurator.set_request_property`` method now issues
1579   a deprecation warning when used.  It had been docs-deprecated in 1.4
1580   but did not issue a deprecation warning when used.
1581
1582 1.5a1 (2013-08-30)
1583 ==================
1584
1585 Features
1586 --------
1587
1588 - A new http exception subclass named ``pyramid.httpexceptions.HTTPSuccessful``
1589   was added.  You can use this class as the ``context`` of an exception
1590   view to catch all 200-series "exceptions" (e.g. "raise HTTPOk").  This
1591   also allows you to catch *only* the ``HTTPOk`` exception itself; previously
1592   this was impossible because a number of other exceptions
1593   (such as ``HTTPNoContent``) inherited from ``HTTPOk``, but now they do not.
1594
1595 - You can now generate "hybrid" urldispatch/traversal URLs more easily
1596   by using the new ``route_name``, ``route_kw`` and ``route_remainder_name``
1597   arguments to  ``request.resource_url`` and ``request.resource_path``.  See
1598   the new section of the "Combining Traversal and URL Dispatch" documentation
1599   chapter entitled  "Hybrid URL Generation".
1600
1601 - It is now possible to escape double braces in Pyramid scaffolds (unescaped,
1602   these represent replacement values).  You can use ``\{\{a\}\}`` to
1603   represent a "bare" ``{{a}}``.  See
1604   https://github.com/Pylons/pyramid/pull/862
1605
1606 - Add ``localizer`` and ``locale_name`` properties (reified) to the request.
1607   See https://github.com/Pylons/pyramid/issues/508.  Note that the
1608   ``pyramid.i18n.get_localizer`` and ``pyramid.i18n.get_locale_name`` functions
1609   now simply look up these properties on the request.
1610
1611 - Add ``pdistreport`` script, which prints the Python version in use, the
1612   Pyramid version in use, and the version number and location of all Python
1613   distributions currently installed.
1614
1615 - Add the ability to invert the result of any view, route, or subscriber
1616   predicate using the ``not_`` class.  For example::
1617
1618      from pyramid.config import not_
1619
1620      @view_config(route_name='myroute', request_method=not_('POST'))
1621      def myview(request): ...
1622
1623   The above example will ensure that the view is called if the request method
1624   is not POST (at least if no other view is more specific).
1625
1626   The ``pyramid.config.not_`` class can be used against any value that is
1627   a predicate value passed in any of these contexts:
1628
1629   - ``pyramid.config.Configurator.add_view``
1630
1631   - ``pyramid.config.Configurator.add_route``
1632
1633   - ``pyramid.config.Configurator.add_subscriber``
1634
1635   - ``pyramid.view.view_config``
1636
1637   - ``pyramid.events.subscriber``
1638
1639 - ``scripts/prequest.py``: add support for submitting ``PUT`` and ``PATCH``
1640   requests.  See https://github.com/Pylons/pyramid/pull/1033.  add support for
1641   submitting ``OPTIONS`` and ``PROPFIND`` requests, and  allow users to specify
1642   basic authentication credentials in the request via a ``--login`` argument to
1643   the script.  See https://github.com/Pylons/pyramid/pull/1039.
1644
1645 - ``ACLAuthorizationPolicy`` supports ``__acl__`` as a callable. This
1646   removes the ambiguity between the potential ``AttributeError`` that would
1647   be raised on the ``context`` when the property was not defined and the
1648   ``AttributeError`` that could be raised from any user-defined code within
1649   a dynamic property. It is recommended to define a dynamic ACL as a callable
1650   to avoid this ambiguity. See https://github.com/Pylons/pyramid/issues/735.
1651
1652 - Allow a protocol-relative URL (e.g. ``//example.com/images``) to be passed to
1653   ``pyramid.config.Configurator.add_static_view``. This allows
1654   externally-hosted static URLs to be generated based on the current protocol.
1655
1656 - The ``AuthTktAuthenticationPolicy`` has two new options to configure its
1657   domain usage:
1658
1659   * ``parent_domain``: if set the authentication cookie is set on
1660     the parent domain. This is useful if you have multiple sites sharing the
1661     same domain.
1662   * ``domain``: if provided the cookie is always set for this domain, bypassing
1663     all usual logic.
1664
1665   See https://github.com/Pylons/pyramid/pull/1028,
1666   https://github.com/Pylons/pyramid/pull/1072 and
1667   https://github.com/Pylons/pyramid/pull/1078.
1668
1669 - The ``AuthTktAuthenticationPolicy`` now supports IPv6 addresses when using
1670   the ``include_ip=True`` option. This is possibly incompatible with
1671   alternative ``auth_tkt`` implementations, as the specification does not
1672   define how to properly handle IPv6. See
1673   https://github.com/Pylons/pyramid/issues/831.
1674
1675 - Make it possible to use variable arguments via
1676   ``pyramid.paster.get_appsettings``. This also allowed the generated
1677   ``initialize_db`` script from the ``alchemy`` scaffold to grow support
1678   for options in the form ``a=1 b=2`` so you can fill in
1679   values in a parameterized ``.ini`` file, e.g.
1680   ``initialize_myapp_db etc/development.ini a=1 b=2``.
1681   See https://github.com/Pylons/pyramid/pull/911
1682
1683 - The ``request.session.check_csrf_token()`` method and the ``check_csrf`` view
1684   predicate now take into account the value of the HTTP header named
1685   ``X-CSRF-Token`` (as well as the ``csrf_token`` form parameter, which they
1686   always did).  The header is tried when the form parameter does not exist.
1687
1688 - View lookup will now search for valid views based on the inheritance
1689   hierarchy of the context. It tries to find views based on the most
1690   specific context first, and upon predicate failure, will move up the
1691   inheritance chain to test views found by the super-type of the context.
1692   In the past, only the most specific type containing views would be checked
1693   and if no matching view could be found then a PredicateMismatch would be
1694   raised. Now predicate mismatches don't hide valid views registered on
1695   super-types. Here's an example that now works::
1696
1697      class IResource(Interface):
1698
1699          ...
1700
1701      @view_config(context=IResource)
1702      def get(context, request):
1703
1704          ...
1705
1706      @view_config(context=IResource, request_method='POST')
1707      def post(context, request):
1708
1709          ...
1710
1711      @view_config(context=IResource, request_method='DELETE')
1712      def delete(context, request):
1713
1714          ...
1715
1716      @implementer(IResource)
1717      class MyResource:
1718
1719          ...
1720
1721      @view_config(context=MyResource, request_method='POST')
1722      def override_post(context, request):
1723
1724          ...
1725
1726   Previously the override_post view registration would hide the get
1727   and delete views in the context of MyResource -- leading to a
1728   predicate mismatch error when trying to use GET or DELETE
1729   methods. Now the views are found and no predicate mismatch is
1730   raised.
1731   See https://github.com/Pylons/pyramid/pull/786 and
1732   https://github.com/Pylons/pyramid/pull/1004 and
1733   https://github.com/Pylons/pyramid/pull/1046
1734
1735 - The ``pserve`` command now takes a ``-v`` (or ``--verbose``) flag and a
1736   ``-q`` (or ``--quiet``) flag.  Output from running ``pserve`` can be
1737   controlled using these flags.  ``-v`` can be specified multiple times to
1738   increase verbosity.  ``-q`` sets verbosity to ``0`` unconditionally.  The
1739   default verbosity level is ``1``.
1740
1741 - The ``alchemy`` scaffold tests now provide better coverage.  See
1742   https://github.com/Pylons/pyramid/pull/1029
1743
1744 - The ``pyramid.config.Configurator.add_route`` method now supports being
1745   called with an external URL as pattern. See
1746   https://github.com/Pylons/pyramid/issues/611 and the documentation section
1747   in the "URL Dispatch" chapter entitled "External Routes" for more information.
1748
1749 Bug Fixes
1750 ---------
1751
1752 - It was not possible to use ``pyramid.httpexceptions.HTTPException`` as
1753   the ``context`` of an exception view as very general catchall for
1754   http-related exceptions when you wanted that exception view to override the
1755   default exception view.  See https://github.com/Pylons/pyramid/issues/985
1756
1757 - When the ``pyramid.reload_templates`` setting was true, and a Chameleon
1758   template was reloaded, and the renderer specification named a macro
1759   (e.g. ``foo#macroname.pt``), renderings of the template after the template
1760   was reloaded due to a file change would produce the entire template body
1761   instead of just a rendering of the macro.  See
1762   https://github.com/Pylons/pyramid/issues/1013.
1763
1764 - Fix an obscure problem when combining a virtual root with a route with a
1765   ``*traverse`` in its pattern.  Now the traversal path generated in
1766   such a configuration will be correct, instead of an element missing
1767   a leading slash.
1768
1769 - Fixed a Mako renderer bug returning a tuple with a previous defname value
1770   in some circumstances. See https://github.com/Pylons/pyramid/issues/1037
1771   for more information.
1772
1773 - Make the ``pyramid.config.assets.PackageOverrides`` object implement the API
1774   for ``__loader__`` objects specified in PEP 302.  Proxies to the
1775   ``__loader__`` set by the importer, if present; otherwise, raises
1776   ``NotImplementedError``.  This makes Pyramid static view overrides work
1777   properly under Python 3.3 (previously they would not).  See
1778   https://github.com/Pylons/pyramid/pull/1015 for more information.
1779
1780 - ``mako_templating``: added defensive workaround for non-importability of
1781   ``mako`` due to upstream ``markupsafe`` dropping Python 3.2 support.  Mako
1782   templating will no longer work under the combination of MarkupSafe 0.17 and
1783   Python 3.2 (although the combination of MarkupSafe 0.17 and Python 3.3 or any
1784   supported Python 2 version will work OK).
1785
1786 - Spaces and dots may now be in mako renderer template paths. This was
1787   broken when support for the new makodef syntax was added in 1.4a1.
1788   See https://github.com/Pylons/pyramid/issues/950
1789
1790 - ``pyramid.debug_authorization=true`` will now correctly print out
1791   ``Allowed`` for views registered with ``NO_PERMISSION_REQUIRED`` instead
1792   of invoking the ``permits`` method of the authorization policy.
1793   See https://github.com/Pylons/pyramid/issues/954
1794
1795 - Pyramid failed to install on some systems due to being packaged with
1796   some test files containing higher order characters in their names. These
1797   files have now been removed. See
1798   https://github.com/Pylons/pyramid/issues/981
1799
1800 - ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so code under
1801   Python 3 would use ``__len__`` to find truthiness; this usually caused an
1802   instance of DummyResource to be "falsy" instead of "truthy".  See
1803   https://github.com/Pylons/pyramid/pull/1032
1804
1805 - The ``alchemy`` scaffold would break when the database was MySQL during
1806   tables creation.  See https://github.com/Pylons/pyramid/pull/1049
1807
1808 - The ``current_route_url`` method now attaches the query string to the URL by
1809   default. See
1810   https://github.com/Pylons/pyramid/issues/1040
1811
1812 - Make ``pserve.cherrypy_server_runner`` Python 3 compatible. See
1813   https://github.com/Pylons/pyramid/issues/718
1814
1815 Backwards Incompatibilities
1816 ---------------------------
1817
1818 - Modified the ``current_route_url`` method in pyramid.Request. The method
1819   previously returned the URL without the query string by default, it now does
1820   attach the query string unless it is overriden.
1821
1822 - The ``route_url`` and ``route_path`` APIs no longer quote ``/``
1823   to ``%2F`` when a replacement value contains a ``/``.  This was pointless,
1824   as WSGI servers always unquote the slash anyway, and Pyramid never sees the
1825   quoted value.
1826
1827 - It is no longer possible to set a ``locale_name`` attribute of the request,
1828   nor is it possible to set a ``localizer`` attribute of the request.  These
1829   are now "reified" properties that look up a locale name and localizer
1830   respectively using the machinery described in the "Internationalization"
1831   chapter of the documentation.
1832
1833 - If you send an ``X-Vhm-Root`` header with a value that ends with a slash (or
1834   any number of slashes), the trailing slash(es) will be removed before a URL
1835   is generated when you use use ``request.resource_url`` or
1836   ``request.resource_path``.  Previously the virtual root path would not have
1837   trailing slashes stripped, which would influence URL generation.
1838
1839 - The ``pyramid.interfaces.IResourceURL`` interface has now grown two new
1840   attributes: ``virtual_path_tuple`` and ``physical_path_tuple``.  These should
1841   be the tuple form of the resource's path (physical and virtual).
1842
4a86b2 1843 1.4 (2012-12-18)
CM 1844 ================
1845
1846 Docs
1847 ----
1848
1849 - Fix functional tests in the ZODB tutorial
1850
1851 1.4b3 (2012-12-10)
1852 ==================
1853
1854 - Packaging release only, no code changes.  1.4b2 was a brownbag release due to
1855   missing directories in the tarball.
1856
1857 1.4b2 (2012-12-10)
1858 ==================
1859
1860 Docs
1861 ----
1862
1863 - Scaffolding is now PEP-8 compliant (at least for a brief shining moment).
1864
1865 - Tutorial improvements.
1866
1867 Backwards Incompatibilities
1868 ---------------------------
1869
1870 - Modified the ``_depth`` argument to ``pyramid.view.view_config`` to accept
1871   a value relative to the invocation of ``view_config`` itself. Thus, when it
1872   was previously expecting a value of ``1`` or greater, to reflect that
1873   the caller of ``view_config`` is 1 stack frame away from ``venusian.attach``,
1874   this implementation detail is now hidden.
1875
1876 - Modified the ``_backframes`` argument to ``pyramid.util.action_method`` in a
1877   similar way to the changes described to ``_depth`` above.  This argument
1878   remains undocumented, but might be used in the wild by some insane person.
1879
1880 1.4b1 (2012-11-21)
1881 ==================
1882
1883 Features
1884 --------
1885
1886 - Small microspeed enhancement which anticipates that a
1887   ``pyramid.response.Response`` object is likely to be returned from a view.
1888   Some code is shortcut if the class of the object returned by a view is this
1889   class.  A similar microoptimization was done to
1890   ``pyramid.request.Request.is_response``.
1891
1892 - Make it possible to use variable arguments on ``p*`` commands (``pserve``,
1893   ``pshell``, ``pviews``, etc) in the form ``a=1 b=2`` so you can fill in
1894   values in parameterized ``.ini`` file, e.g. ``pshell etc/development.ini
1895   http_port=8080``.  See https://github.com/Pylons/pyramid/pull/714
1896
1897 - A somewhat advanced and obscure feature of Pyramid event handlers is their
1898   ability to handle "multi-interface" notifications.  These notifications have
1899   traditionally presented multiple objects to the subscriber callable.  For
1900   instance, if an event was sent by code like this::
1901
1902      registry.notify(event, context)
1903
1904   In the past, in order to catch such an event, you were obligated to write and
1905   register an event subscriber that mentioned both the event and the context in
1906   its argument list::
1907
1908      @subscriber([SomeEvent, SomeContextType])
1909      def asubscriber(event, context):
1910          pass
1911
1912   In many subscriber callables registered this way, it was common for the logic
1913   in the subscriber callable to completely ignore the second and following
1914   arguments (e.g. ``context`` in the above example might be ignored), because
1915   they usually existed as attributes of the event anyway.  You could usually
1916   get the same value by doing ``event.context`` or similar.
1917
1918   The fact that you needed to put an extra argument which you usually ignored
1919   in the subscriber callable body was only a minor annoyance until we added
1920   "subscriber predicates", used to narrow the set of circumstances under which
1921   a subscriber will be executed, in a prior 1.4 alpha release.  Once those were
1922   added, the annoyance was escalated, because subscriber predicates needed to
1923   accept the same argument list and arity as the subscriber callables that they
1924   were configured against.  So, for example, if you had these two subscriber
1925   registrations in your code::
1926
1927      @subscriber([SomeEvent, SomeContextType])
1928      def asubscriber(event, context):
1929          pass
1930
1931      @subscriber(SomeOtherEvent)
1932      def asubscriber(event):
1933          pass
1934
1935   And you wanted to use a subscriber predicate::
1936
1937      @subscriber([SomeEvent, SomeContextType], mypredicate=True)
1938      def asubscriber1(event, context):
1939          pass
1940
1941      @subscriber(SomeOtherEvent, mypredicate=True)
1942      def asubscriber2(event):
1943          pass
1944
1945   If an existing ``mypredicate`` subscriber predicate had been written in such
1946   a way that it accepted only one argument in its ``__call__``, you could not
1947   use it against a subscription which named more than one interface in its
1948   subscriber interface list.  Similarly, if you had written a subscriber
1949   predicate that accepted two arguments, you couldn't use it against a
1950   registration that named only a single interface type.
1951
1952   For example, if you created this predicate::
1953
1954     class MyPredicate(object):
1955         # portions elided...
1956         def __call__(self, event):
1957             return self.val == event.context.foo
1958
1959   It would not work against a multi-interface-registered subscription, so in
1960   the above example, when you attempted to use it against ``asubscriber1``, it
1961   would fail at runtime with a TypeError, claiming something was attempting to
1962   call it with too many arguments.
1963
1964   To hack around this limitation, you were obligated to design the
1965   ``mypredicate`` predicate to expect to receive in its ``__call__`` either a
1966   single ``event`` argument (a SomeOtherEvent object) *or* a pair of arguments
1967   (a SomeEvent object and a SomeContextType object), presumably by doing
1968   something like this::
1969
1970     class MyPredicate(object):
1971         # portions elided...
1972         def __call__(self, event, context=None):
1973             return self.val == event.context.foo
1974
1975   This was confusing and bad.
1976
1977   In order to allow people to ignore unused arguments to subscriber callables
1978   and to normalize the relationship between event subscribers and subscriber
1979   predicates, we now allow both subscribers and subscriber predicates to accept
1980   only a single ``event`` argument even if they've been subscribed for
1981   notifications that involve multiple interfaces.  Subscribers and subscriber
1982   predicates that accept only one argument will receive the first object passed
1983   to ``notify``; this is typically (but not always) the event object.  The
1984   other objects involved in the subscription lookup will be discarded.  You can
1985   now write an event subscriber that accepts only ``event`` even if it
1986   subscribes to multiple interfaces::
1987
1988      @subscriber([SomeEvent, SomeContextType])
1989      def asubscriber(event):
1990          # this will work!
1991
1992   This prevents you from needing to match the subscriber callable parameters to
1993   the subscription type unnecessarily, especially when you don't make use of
1994   any argument in your subscribers except for the event object itself.
1995
1996   Note, however, that if the event object is not the first
1997   object in the call to ``notify``, you'll run into trouble.  For example, if
1998   notify is called with the context argument first::
1999
2000      registry.notify(context, event)
2001
2002   You won't be able to take advantage of the event-only feature.  It will
2003   "work", but the object received by your event handler won't be the event
2004   object, it will be the context object, which won't be very useful::
2005
2006      @subscriber([SomeContextType, SomeEvent])
2007      def asubscriber(event):
2008          # bzzt! you'll be getting the context here as ``event``, and it'll
2009          # be useless
2010
2011   Existing multiple-argument subscribers continue to work without issue, so you
2012   should continue use those if your system notifies using multiple interfaces
2013   and the first interface is not the event interface.  For example::
2014
2015      @subscriber([SomeContextType, SomeEvent])
2016      def asubscriber(context, event):
2017          # this will still work!
2018
2019   The event-only feature makes it possible to use a subscriber predicate that
2020   accepts only a request argument within both multiple-interface subscriber
2021   registrations and single-interface subscriber registrations.  You needn't
2022   make slightly different variations of predicates depending on the
2023   subscription type arguments.  Instead, just write all your subscriber
2024   predicates so they only accept ``event`` in their ``__call__`` and they'll be
2025   useful across all registrations for subscriptions that use an event as their
2026   first argument, even ones which accept more than just ``event``.
2027
2028   However, the same caveat applies to predicates as to subscriber callables: if
2029   you're subscribing to a multi-interface event, and the first interface is not
2030   the event interface, the predicate won't work properly.  In such a case,
2031   you'll need to match the predicate ``__call__`` argument ordering and
2032   composition to the ordering of the interfaces.  For example, if the
2033   registration for the subscription uses ``[SomeContext, SomeEvent]``, you'll
2034   need to reflect that in the ordering of the parameters of the predicate's
2035   ``__call__`` method::
2036
2037         def __call__(self, context, event):
2038             return event.request.path.startswith(self.val)
2039
2040   tl;dr: 1) When using multi-interface subscriptions, always use the event type
2041   as the first subscription registration argument and 2) When 1 is true, use
2042   only ``event`` in your subscriber and subscriber predicate parameter lists,
2043   no matter how many interfaces the subscriber is notified with.  This
2044   combination will result in the maximum amount of reusability of subscriber
2045   predicates and the least amount of thought on your part.  Drink responsibly.
2046
2047 Bug Fixes
2048 ---------
2049
2050 - A failure when trying to locate the attribute ``__text__`` on route and view
2051   predicates existed when the ``debug_routematch`` setting was true or when the
2052   ``pviews`` command was used. See https://github.com/Pylons/pyramid/pull/727
2053
2054 Documentation
2055 -------------
2056
2057 - Sync up tutorial source files with the files that are rendered by the
2058   scaffold that each uses.
2059
2060 1.4a4 (2012-11-14)
2061 ==================
2062
2063 Features
2064 --------
2065
2066 - ``pyramid.authentication.AuthTktAuthenticationPolicy`` has been updated to
2067   support newer hashing algorithms such as ``sha512``. Existing applications
2068   should consider updating if possible for improved security over the default
2069   md5 hashing.
2070
2071 - Added an ``effective_principals`` route and view predicate.
2072
2073 - Do not allow the userid returned from the ``authenticated_userid`` or the
2074   userid that is one of the list of principals returned by
2075   ``effective_principals`` to be either of the strings ``system.Everyone`` or
2076   ``system.Authenticated`` when any of the built-in authorization policies that
2077   live in ``pyramid.authentication`` are in use.  These two strings are
2078   reserved for internal usage by Pyramid and they will not be accepted as valid
2079   userids.
2080
2081 - Slightly better debug logging from
2082   ``pyramid.authentication.RepozeWho1AuthenticationPolicy``.
2083
2084 - ``pyramid.security.view_execution_permitted`` used to return ``True`` if no
2085   view could be found. It now raises a ``TypeError`` exception in that case, as
2086   it doesn't make sense to assert that a nonexistent view is
2087   execution-permitted. See https://github.com/Pylons/pyramid/issues/299.
2088
2089 - Allow a ``_depth`` argument to ``pyramid.view.view_config``, which will
2090   permit limited composition reuse of the decorator by other software that
2091   wants to provide custom decorators that are much like view_config.
2092
2093 - Allow an iterable of decorators to be passed to
2094   ``pyramid.config.Configurator.add_view``. This allows views to be wrapped
2095   by more than one decorator without requiring combining the decorators
2096   yourself.
2097
2098 Bug Fixes
2099 ---------
2100
2101 - In the past if a renderer returned ``None``, the body of the resulting
2102   response would be set explicitly to the empty string.  Instead, now, the body
2103   is left unchanged, which allows the renderer to set a body itself by using
2104   e.g. ``request.response.body = b'foo'``.  The body set by the renderer will
2105   be unmolested on the way out.  See
2106   https://github.com/Pylons/pyramid/issues/709
2107
2108 - In uncommon cases, the ``pyramid_excview_tween_factory`` might have
2109   inadvertently raised a ``KeyError`` looking for ``request_iface`` as an
2110   attribute of the request.  It no longer fails in this case.  See
2111   https://github.com/Pylons/pyramid/issues/700
2112
2113 - Be more tolerant of potential error conditions in ``match_param`` and
2114   ``physical_path`` predicate implementations; instead of raising an exception,
2115   return False.
2116
2117 - ``pyramid.view.render_view`` was not functioning properly under Python 3.x
2118   due to a byte/unicode discrepancy. See
2119   https://github.com/Pylons/pyramid/issues/721
2120
2121 Deprecations
2122 ------------
2123
2124 - ``pyramid.authentication.AuthTktAuthenticationPolicy`` will emit a warning if
2125   an application is using the policy without explicitly passing a ``hashalg``
2126   argument. This is because the default is "md5" which is considered
2127   theoretically subject to collision attacks. If you really want "md5" then you
2128   must specify it explicitly to get rid of the warning.
2129
2130 Documentation
2131 -------------
2132
2133 - All of the tutorials that use
2134   ``pyramid.authentication.AuthTktAuthenticationPolicy`` now explicitly pass
2135   ``sha512`` as a ``hashalg`` argument.
2136
2137
2138 Internals
2139 ---------
2140
2141 - Move ``TopologicalSorter`` from ``pyramid.config.util`` to ``pyramid.util``,
2142   move ``CyclicDependencyError`` from ``pyramid.config.util`` to
2143   ``pyramid.exceptions``, rename ``Singleton`` to ``Sentinel`` and move from
2144   ``pyramid.config.util`` to ``pyramid.util``; this is in an effort to
2145   move that stuff that may be an API one day out of ``pyramid.config.util``,
2146   because that package should never be imported from non-Pyramid code.
2147   TopologicalSorter is still not an API, but may become one.
2148
2149 - Get rid of shady monkeypatching of ``pyramid.request.Request`` and
2150   ``pyramid.response.Response`` done within the ``__init__.py`` of Pyramid.
2151   Webob no longer relies on this being done.  Instead, the ResponseClass
2152   attribute of the Pyramid Request class is assigned to the Pyramid response
2153   class; that's enough to satisfy WebOb and behave as it did before with the
2154   monkeypatching.
2155
2156 1.4a3 (2012-10-26)
2157 ==================
2158
2159 Bug Fixes
2160 ---------
2161
2162 - The match_param predicate's text method was fixed to sort its values.
2163   Part of https://github.com/Pylons/pyramid/pull/705
2164
2165 - 1.4a ``pyramid.scripting.prepare`` behaved differently than 1.3 series
2166   function of same name.  In particular, if passed a request, it would not
2167   set the ``registry`` attribute of the request like 1.3 did.  A symptom
2168   would be that passing a request to ``pyramid.paster.bootstrap`` (which uses
2169   the function) that did not have a ``registry`` attribute could assume that
2170   the registry would be attached to the request by Pyramid.  This assumption
2171   could be made in 1.3, but not in 1.4.  The assumption can now be made in
2172   1.4 too (a registry is attached to a request passed to bootstrap or
2173   prepare).
2174
2175 - When registering a view configuration that named a Chameleon ZPT renderer
2176   with a macro name in it (e.g. ``renderer='some/template#somemacro.pt``) as
2177   well as a view configuration without a macro name in it that pointed to the
2178   same template (e.g. ``renderer='some/template.pt'``), internal caching could
2179   confuse the two, and your code might have rendered one instead of the
2180   other.
2181
2182 Features
2183 --------
2184
2185 - Allow multiple values to be specified to the ``request_param`` view/route
2186   predicate as a sequence.  Previously only a single string value was allowed.
2187   See https://github.com/Pylons/pyramid/pull/705
2188
2189 - Comments with references to documentation sections placed in scaffold
2190   ``.ini`` files.
2191
2192 - Added an HTTP Basic authentication policy
2193   at ``pyramid.authentication.BasicAuthAuthenticationPolicy``.
2194
2195 - The Configurator ``testing_securitypolicy`` method now returns the policy
2196   object it creates.
2197
2198 - The Configurator ``testing_securitypolicy`` method accepts two new
2199   arguments: ``remember_result`` and ``forget_result``.  If supplied, these
2200   values influence the result of the policy's ``remember`` and ``forget``
2201   methods, respectively.
2202
2203 - The DummySecurityPolicy created by ``testing_securitypolicy`` now sets a
2204   ``forgotten`` value on the policy (the value ``True``) when its ``forget``
2205   method is called.
2206
2207 - The DummySecurityPolicy created by ``testing_securitypolicy`` now sets a
2208   ``remembered`` value on the policy, which is the value of the ``principal``
2209   argument it's called with when its ``remember`` method is called.
2210
2211 - New ``physical_path`` view predicate.  If specified, this value should be a
2212   string or a tuple representing the physical traversal path of the context
2213   found via traversal for this predicate to match as true.  For example:
2214   ``physical_path='/'`` or ``physical_path='/a/b/c'`` or ``physical_path=('',
2215   'a', 'b', 'c')``.  This is not a path prefix match or a regex, it's a
2216   whole-path match.  It's useful when you want to always potentially show a
2217   view when some object is traversed to, but you can't be sure about what kind
2218   of object it will be, so you can't use the ``context`` predicate.  The
2219   individual path elements inbetween slash characters or in tuple elements
2220   should be the Unicode representation of the name of the resource and should
2221   not be encoded in any way.
2222
2223 1.4a2 (2012-09-27)
2224 ==================
2225
2226 Bug Fixes
2227 ---------
2228
2229 - When trying to determine Mako defnames and Chameleon macro names in asset
2230   specifications, take into account that the filename may have a hyphen in
2231   it.  See https://github.com/Pylons/pyramid/pull/692
2232
2233 Features
2234 --------
2235
2236 - A new ``pyramid.session.check_csrf_token`` convenience function was added.
2237
2238 - A ``check_csrf`` view predicate was added.  For example, you can now do
2239   ``config.add_view(someview, check_csrf=True)``.  When the predicate is
2240   checked, if the ``csrf_token`` value in ``request.params`` matches the CSRF
2241   token in the request's session, the view will be permitted to execute.
2242   Otherwise, it will not be permitted to execute.
2243
2244 - Add ``Base.metadata.bind = engine`` to alchemy template, so that tables
2245   defined imperatively will work.
2246
2247 Documentation
2248 -------------
2249
2250 - update wiki2 SQLA tutorial with the changes required after inserting
2251   ``Base.metadata.bind = engine`` into the alchemy scaffold.
2252
2253 1.4a1 (2012-09-16)
2254 ==================
2255
2256 Bug Fixes
2257 ---------
2258
2259 - Forward port from 1.3 branch: When no authentication policy was configured,
2260   a call to ``pyramid.security.effective_principals`` would unconditionally
2261   return the empty list.  This was incorrect, it should have unconditionally
2262   returned ``[Everyone]``, and now does.
2263
2264 - Explicit url dispatch regexes can now contain colons.
2265   https://github.com/Pylons/pyramid/issues/629
2266
2267 - On at least one 64-bit Ubuntu system under Python 3.2, using the
2268   ``view_config`` decorator caused a ``RuntimeError: dictionary changed size
2269   during iteration`` exception.  It no longer does.  See
2270   https://github.com/Pylons/pyramid/issues/635 for more information.
2271
2272 - In Mako Templates lookup, check if the uri is already adjusted and bring
2273   it back to an asset spec. Normally occurs with inherited templates or
2274   included components.
2275   https://github.com/Pylons/pyramid/issues/606
2276   https://github.com/Pylons/pyramid/issues/607
2277
2278 - In Mako Templates lookup, check for absolute uri (using mako directories)
2279   when mixing up inheritance with asset specs.
2280   https://github.com/Pylons/pyramid/issues/662
2281
2282 - HTTP Accept headers were not being normalized causing potentially
2283   conflicting view registrations to go unnoticed. Two views that only
2284   differ in the case ('text/html' vs. 'text/HTML') will now raise an error.
2285   https://github.com/Pylons/pyramid/pull/620
2286
2287 - Forward-port from 1.3 branch: when registering multiple views with an
2288   ``accept`` predicate in a Pyramid application runing under Python 3, you
2289   might have received a ``TypeError: unorderable types: function() <
2290   function()`` exception.
2291
2292 Features
2293 --------
2294
169dba 2295 - Python 3.3 compatibility.
SP 2296
4a86b2 2297 - Configurator.add_directive now accepts arbitrary callables like partials or
CM 2298   objects implementing ``__call__`` which dont have ``__name__`` and
2299   ``__doc__`` attributes.  See https://github.com/Pylons/pyramid/issues/621
2300   and https://github.com/Pylons/pyramid/pull/647.
2301
2302 - Third-party custom view, route, and subscriber predicates can now be added
2303   for use by view authors via
2304   ``pyramid.config.Configurator.add_view_predicate``,
2305   ``pyramid.config.Configurator.add_route_predicate`` and
2306   ``pyramid.config.Configurator.add_subscriber_predicate``.  So, for example,
2307   doing this::
2308
2309      config.add_view_predicate('abc', my.package.ABCPredicate)
2310
2311   Might allow a view author to do this in an application that configured that
2312   predicate::
2313
2314      @view_config(abc=1)
2315
2316   Similar features exist for ``add_route``, and ``add_subscriber``.  See
2317   "Adding A Third Party View, Route, or Subscriber Predicate" in the Hooks
2318   chapter for more information.
2319
2320   Note that changes made to support the above feature now means that only
2321   actions registered using the same "order" can conflict with one another.
2322   It used to be the case that actions registered at different orders could
2323   potentially conflict, but to my knowledge nothing ever depended on this
2324   behavior (it was a bit silly).
2325
2326 - Custom objects can be made easily JSON-serializable in Pyramid by defining
2327   a ``__json__`` method on the object's class. This method should return
2328   values natively serializable by ``json.dumps`` (such as ints, lists,
2329   dictionaries, strings, and so forth).
2330
2331 - The JSON renderer now allows for the definition of custom type adapters to
2332   convert unknown objects to JSON serializations.
2333
2334 - As of this release, the ``request_method`` predicate, when used, will also
2335   imply that ``HEAD`` is implied when you use ``GET``.  For example, using
2336   ``@view_config(request_method='GET')`` is equivalent to using
2337   ``@view_config(request_method=('GET', 'HEAD'))``.  Using
2338   ``@view_config(request_method=('GET', 'POST')`` is equivalent to using
2339   ``@view_config(request_method=('GET', 'HEAD', 'POST')``.  This is because
2340   HEAD is a variant of GET that omits the body, and WebOb has special support
2341   to return an empty body when a HEAD is used.
2342
2343 - ``config.add_request_method`` has been introduced to support extending
2344   request objects with arbitrary callables. This method expands on the
2345   previous ``config.set_request_property`` by supporting methods as well as
2346   properties. This method now causes less code to be executed at
2347   request construction time than ``config.set_request_property`` in
2348   version 1.3.
2349
2350 - Don't add a ``?`` to URLs generated by ``request.resource_url`` if the
2351   ``query`` argument is provided but empty.
2352
2353 - Don't add a ``?`` to URLs generated by ``request.route_url`` if the
2354   ``_query`` argument is provided but empty.
2355
2356 - The static view machinery now raises (rather than returns) ``HTTPNotFound``
2357   and ``HTTPMovedPermanently`` exceptions, so these can be caught by the
2358   Not Found View (and other exception views).
2359
2360 - The Mako renderer now supports a def name in an asset spec.  When the def
2361   name is present in the asset spec, the system will render the template def
2362   within the template and will return the result. An example asset spec is
2363   ``package:path/to/template#defname.mako``. This will render the def named
2364   ``defname`` inside the ``template.mako`` template instead of rendering the
2365   entire template.  The old way of returning a tuple in the form
2366   ``('defname', {})`` from the view is supported for backward compatibility,
2367
2368 - The Chameleon ZPT renderer now accepts a macro name in an asset spec.  When
2369   the macro name is present in the asset spec, the system will render the
2370   macro listed as a ``define-macro`` and return the result instead of
2371   rendering the entire template.  An example asset spec:
2372   ``package:path/to/template#macroname.pt``.  This will render the macro
2373   defined as ``macroname`` within the ``template.pt`` template instead of the
2374   entire templae.
2375
2376 - When there is a predicate mismatch exception (seen when no view matches for
2377   a given request due to predicates not working), the exception now contains
2378   a textual description of the predicate which didn't match.
2379
2380 - An ``add_permission`` directive method was added to the Configurator.  This
2381   directive registers a free-standing permission introspectable into the
2382   Pyramid introspection system.  Frameworks built atop Pyramid can thus use
2383   the ``permissions`` introspectable category data to build a
2384   comprehensive list of permissions supported by a running system.  Before
2385   this method was added, permissions were already registered in this
2386   introspectable category as a side effect of naming them in an ``add_view``
2387   call, this method just makes it possible to arrange for a permission to be
2388   put into the ``permissions`` introspectable category without naming it
2389   along with an associated view.  Here's an example of usage of
2390   ``add_permission``::
2391
2392       config = Configurator()
2393       config.add_permission('view')
2394
2395 - The ``UnencryptedCookieSessionFactoryConfig`` now accepts
2396   ``signed_serialize`` and ``signed_deserialize`` hooks which may be used
2397   to influence how the sessions are marshalled (by default this is done
2398   with HMAC+pickle).
2399
2400 - ``pyramid.testing.DummyRequest`` now supports methods supplied by the
2401   ``pyramid.util.InstancePropertyMixin`` class such as ``set_property``.
2402
2403 - Request properties and methods added via ``config.set_request_property`` or
2404   ``config.add_request_method`` are now available to tweens.
2405
2406 - Request properties and methods added via ``config.set_request_property`` or
2407   ``config.add_request_method`` are now available in the request object
2408   returned from ``pyramid.paster.bootstrap``.
2409
2410 - ``request.context`` of environment request during ``bootstrap`` is now the
2411   root object if a context isn't already set on a provided request.
2412
2413 - The ``pyramid.decorator.reify`` function is now an API, and was added to
2414   the API documentation.
2415
2416 - Added the ``pyramid.testing.testConfig`` context manager, which can be used
2417   to generate a configurator in a test, e.g. ``with testing.testConfig(...):``.
2418
2419 - Users can now invoke a subrequest from within view code using a new
2420   ``request.invoke_subrequest`` API.
2421
2422 Deprecations
2423 ------------
2424
2425 - The ``pyramid.config.Configurator.set_request_property`` has been
2426   documentation-deprecated.  The method remains usable but the more
2427   featureful ``pyramid.config.Configurator.add_request_method`` should be
2428   used in its place (it has all of the same capabilities but can also extend
2429   the request object with methods).
2430
2431 Backwards Incompatibilities
2432 ---------------------------
2433
2434 - The Pyramid router no longer adds the values ``bfg.routes.route`` or
2435   ``bfg.routes.matchdict`` to the request's WSGI environment dictionary.
2436   These values were docs-deprecated in ``repoze.bfg`` 1.0 (effectively seven
2437   minor releases ago).  If your code depended on these values, use
2438   request.matched_route and request.matchdict instead.
2439
2440 - It is no longer possible to pass an environ dictionary directly to
2441   ``pyramid.traversal.ResourceTreeTraverser.__call__`` (aka
2442   ``ModelGraphTraverser.__call__``).  Instead, you must pass a request
2443   object.  Passing an environment instead of a request has generated a
2444   deprecation warning since Pyramid 1.1.
2445
2446 - Pyramid will no longer work properly if you use the
2447   ``webob.request.LegacyRequest`` as a request factory.  Instances of the
2448   LegacyRequest class have a ``request.path_info`` which return a string.
2449   This Pyramid release assumes that ``request.path_info`` will
2450   unconditionally be Unicode.
2451
2452 - The functions from ``pyramid.chameleon_zpt`` and ``pyramid.chameleon_text``
2453   named ``get_renderer``, ``get_template``, ``render_template``, and
2454   ``render_template_to_response`` have been removed.  These have issued a
2455   deprecation warning upon import since Pyramid 1.0.  Use
2456   ``pyramid.renderers.get_renderer()``,
2457   ``pyramid.renderers.get_renderer().implementation()``,
2458   ``pyramid.renderers.render()`` or ``pyramid.renderers.render_to_response``
2459   respectively instead of these functions.
2460
2461 - The ``pyramid.configuration`` module was removed.  It had been deprecated
2462   since Pyramid 1.0 and printed a deprecation warning upon its use.  Use
2463   ``pyramid.config`` instead.
2464
2465 - The ``pyramid.paster.PyramidTemplate`` API was removed.  It had been
2466   deprecated since Pyramid 1.1 and issued a warning on import.  If your code
2467   depended on this, adjust your code to import
2468   ``pyramid.scaffolds.PyramidTemplate`` instead.
2469
2470 - The ``pyramid.settings.get_settings()`` API was removed.  It had been
2471   printing a deprecation warning since Pyramid 1.0.  If your code depended on
2472   this API, use ``pyramid.threadlocal.get_current_registry().settings``
2473   instead or use the ``settings`` attribute of the registry available from
2474   the request (``request.registry.settings``).
2475
2476 - These APIs from the ``pyramid.testing`` module were removed.  They have
2477   been printing deprecation warnings since Pyramid 1.0:
2478
2479   * ``registerDummySecurityPolicy``, use
2480     ``pyramid.config.Configurator.testing_securitypolicy`` instead.
2481
2482   * ``registerResources`` (aka ``registerModels``, use
2483     ``pyramid.config.Configurator.testing_resources`` instead.
2484
2485   * ``registerEventListener``, use
2486     ``pyramid.config.Configurator.testing_add_subscriber`` instead.
2487
2488   * ``registerTemplateRenderer`` (aka `registerDummyRenderer``), use
2489     ``pyramid.config.Configurator.testing_add_template`` instead.
2490
2491   * ``registerView``, use ``pyramid.config.Configurator.add_view`` instead.
2492
2493   * ``registerUtility``, use
2494     ``pyramid.config.Configurator.registry.registerUtility`` instead.
2495
2496   * ``registerAdapter``, use
2497     ``pyramid.config.Configurator.registry.registerAdapter`` instead.
2498
2499   * ``registerSubscriber``, use
2500     ``pyramid.config.Configurator.add_subscriber`` instead.
2501
2502   * ``registerRoute``, use
2503     ``pyramid.config.Configurator.add_route`` instead.
2504
2505   * ``registerSettings``, use
2506     ``pyramid.config.Configurator.add_settings`` instead.
2507
2508 - In Pyramid 1.3 and previous, the ``__call__`` method of a Response object
2509   was invoked before any finished callbacks were executed.  As of this
2510   release, the ``__call__`` method of a Response object is invoked *after*
2511   finished callbacks are executed.  This is in support of the
2512   ``request.invoke_subrequest`` feature.
2513
2514 - The 200-series exception responses named ``HTTPCreated``, ``HTTPAccepted``, 
2515   ``HTTPNonAuthoritativeInformation``, ``HTTPNoContent``, ``HTTPResetContent``,
2516   and ``HTTPPartialContent`` in ``pyramid.httpexceptions`` no longer inherit
2517   from ``HTTPOk``.  Instead they inherit from a new base class named 
2518   ``HTTPSuccessful``.  This will have no effect on you unless you've registered
2519   an exception view for ``HTTPOk`` and expect that exception view to
2520   catch all the aforementioned exceptions.
2521
2522 Documentation
2523 -------------
2524
2525 - Added an "Upgrading Pyramid" chapter to the narrative documentation.  It
2526   describes how to cope with deprecations and removals of Pyramid APIs and
2527   how to show Pyramid-generated deprecation warnings while running tests and
2528   while running a server.
2529
2530 - Added a "Invoking a Subrequest" chapter to the documentation.  It describes
2531   how to use the new ``request.invoke_subrequest`` API.
2532
2533 Dependencies
2534 ------------
2535
2536 - Pyramid now requires WebOb 1.2b3+ (the prior Pyramid release only relied on
2537   1.2dev+).  This is to ensure that we obtain a version of WebOb that returns
2538   ``request.path_info`` as text.
2539
2c949d 2540 1.3 (2012-03-21)
CM 2541 ================
2542
2543 Bug Fixes
2544 ---------
2545
2546 - When ``pyramid.wsgi.wsgiapp2`` calls the downstream WSGI app, the app's
2547   environ will no longer have (deprecated and potentially misleading)
2548   ``bfg.routes.matchdict`` or ``bfg.routes.route`` keys in it.  A symptom of
2549   this bug would be a ``wsgiapp2``-wrapped Pyramid app finding the wrong view
2550   because it mistakenly detects that a route was matched when, in fact, it
2551   was not.
2552
2553 - The fix for issue https://github.com/Pylons/pyramid/issues/461 (which made
2554   it possible for instance methods to be used as view callables) introduced a
2555   backwards incompatibility when methods that declared only a request
2556   argument were used.  See https://github.com/Pylons/pyramid/issues/503
2557
2558 1.3b3 (2012-03-17)
2559 ==================
2560
2561 Bug Fixes
2562 ---------
2563
2564 - ``config.add_view(<aninstancemethod>)`` raised AttributeError involving
2565   ``__text__``.  See https://github.com/Pylons/pyramid/issues/461
2566
2567 - Remove references to do-nothing ``pyramid.debug_templates`` setting in all
2568   Pyramid-provided ``.ini`` files.  This setting previously told Chameleon to
2569   render better exceptions; now Chameleon always renders nice exceptions
2570   regardless of the value of this setting.
2571
2572 Scaffolds
2573 ---------
2574
2575 - The ``alchemy`` scaffold now shows an informative error message in the
2576   browser if the person creating the project forgets to run the
2577   initialization script.
2578
2579 - The ``alchemy`` scaffold initialization script is now called
2580   ``initialize_<projectname>_db`` instead of ``populate_<projectname>``.
2581
2582 Documentation
2583 -------------
2584
2585 - Wiki tutorials improved due to collaboration at PyCon US 2012 sprints.
2586
2587 1.3b2 (2012-03-02)
2588 ==================
2589
2590 Bug Fixes
2591 ---------
2592
2593 - The method ``pyramid.request.Request.partial_application_url`` is no longer
2594   in the API docs.  It was meant to be a private method; its publication in
2595   the documentation as an API method was a mistake, and it has been renamed
2596   to something private.
2597
2598 - When a static view was registered using an absolute filesystem path on
2599   Windows, the ``request.static_url`` function did not work to generate URLs
2600   to its resources.  Symptom: "No static URL definition matching
2601   c:\\foo\\bar\\baz".
2602
2603 - Make all tests pass on Windows XP.
2604
2605 - Bug in ACL authentication checking on Python 3: the ``permits`` and
2606   ``principals_allowed_by_permission`` method of
2607   ``pyramid.authorization.ACLAuthenticationPolicy`` could return an
2608   inappropriate ``True`` value when a permission on an ACL was a string
2609   rather than a sequence, and then only if the ACL permission string was a
2610   substring of the ``permission`` value passed to the function.
2611
2612   This bug effects no Pyramid deployment under Python 2; it is a bug that
2613   exists only in deployments running on Python 3.  It has existed since
2614   Pyramid 1.3a1.
2615
2616   This bug was due to the presence of an ``__iter__`` attribute on strings
2617   under Python 3 which is not present under strings in Python 2.
2618
2619 1.3b1 (2012-02-26)
2620 ==================
2621
2622 Bug Fixes
2623 ---------
2624
2625 - ``pyramid.config.Configurator.with_package`` didn't work if the
2626   Configurator was an old-style ``pyramid.configuration.Configurator``
2627   instance.
2628
2629 - Pyramid authorization policies did not show up in the introspector.
2630
2631 Deprecations
2632 ------------
2633
2634 - All references to the ``tmpl_context`` request variable were removed from
2635   the docs.  Its existence in Pyramid is confusing for people who were never
2636   Pylons users.  It was added as a porting convenience for Pylons users in
2637   Pyramid 1.0, but it never caught on because the Pyramid rendering system is
2638   a lot different than Pylons' was, and alternate ways exist to do what it
2639   was designed to offer in Pylons.  It will continue to exist "forever" but
2640   it will not be recommended or mentioned in the docs.
2641
2642 1.3a9 (2012-02-22)
2643 ==================
2644
2645 Features
2646 --------
2647
2648 - Add an ``introspection`` boolean to the Configurator constructor.  If this
2649   is ``True``, actions registered using the Configurator will be registered
2650   with the introspector.  If it is ``False``, they won't.  The default is
2651   ``True``.  Setting it to ``False`` during action processing will prevent
2652   introspection for any following registration statements, and setting it to
2653   ``True`` will start them up again.  This addition is to service a
2654   requirement that the debug toolbar's own views and methods not show up in
2655   the introspector.
2656
2657 - New API: ``pyramid.config.Configurator.add_notfound_view``.  This is a
2658   wrapper for ``pyramid.Config.configurator.add_view`` which provides easy
2659   append_slash support and does the right thing about permissions.  It should
2660   be preferred over calling ``add_view`` directly with
2661   ``context=HTTPNotFound`` as was previously recommended.
2662
2663 - New API: ``pyramid.view.notfound_view_config``.  This is a decorator
2664   constructor like ``pyramid.view.view_config`` that calls
2665   ``pyramid.config.Configurator.add_notfound_view`` when scanned.  It should
2666   be preferred over using ``pyramid.view.view_config`` with
2667   ``context=HTTPNotFound`` as was previously recommended.
2668
2669 - New API: ``pyramid.config.Configurator.add_forbidden_view``.  This is a
2670   wrapper for ``pyramid.Config.configurator.add_view`` which does the right
2671   thing about permissions.  It should be preferred over calling ``add_view``
2672   directly with ``context=HTTPForbidden`` as was previously recommended.
2673
2674 - New API: ``pyramid.view.forbidden_view_config``.  This is a decorator
2675   constructor like ``pyramid.view.view_config`` that calls
2676   ``pyramid.config.Configurator.add_forbidden_view`` when scanned.  It should
2677   be preferred over using ``pyramid.view.view_config`` with
2678   ``context=HTTPForbidden`` as was previously recommended.
2679
2680 - New APIs: ``pyramid.response.FileResponse`` and
2681   ``pyramid.response.FileIter``, for usage in views that must serve files
2682   "manually".
2683
2684 Backwards Incompatibilities
2685 ---------------------------
2686
2687 - Remove ``pyramid.config.Configurator.with_context`` class method.  It was
2688   never an API, it is only used by ``pyramid_zcml`` and its functionality has
2689   been moved to that package's latest release.  This means that you'll need
2690   to use the 0.9.2 or later release of ``pyramid_zcml`` with this release of
2691   Pyramid.
2692
2693 - The ``introspector`` argument to the ``pyramid.config.Configurator``
2694   constructor API has been removed.  It has been replaced by the boolean
2695   ``introspection`` flag.
2696
2697 - The ``pyramid.registry.noop_introspector`` API object has been removed.
2698
2699 - The older deprecated ``set_notfound_view`` Configurator method is now an
2700   alias for the new ``add_notfound_view`` Configurator method.  Likewise, the
2701   older deprecated ``set_forbidden_view`` is now an alias for the new
2702   ``add_forbidden_view``. This has the following impact: the ``context`` sent
2703   to views with a ``(context, request)`` call signature registered via the
2704   ``set_notfound_view`` or ``set_forbidden_view`` will now be an exception
2705   object instead of the actual resource context found.  Use
2706   ``request.context`` to get the actual resource context.  It's also
2707   recommended to disuse ``set_notfound_view`` in favor of
2708   ``add_notfound_view``, and disuse ``set_forbidden_view`` in favor of
2709   ``add_forbidden_view`` despite the aliasing.
2710
2711 Deprecations
2712 ------------
2713
2714 - The API documentation for ``pyramid.view.append_slash_notfound_view`` and
2715   ``pyramid.view.AppendSlashNotFoundViewFactory`` was removed.  These names
2716   still exist and are still importable, but they are no longer APIs.  Use
2717   ``pyramid.config.Configurator.add_notfound_view(append_slash=True)`` or
2718   ``pyramid.view.notfound_view_config(append_slash=True)`` to get the same
2719   behavior.
2720
2721 - The ``set_forbidden_view`` and ``set_notfound_view`` methods of the
2722   Configurator were removed from the documentation.  They have been
2723   deprecated since Pyramid 1.1.
2724
2725 Bug Fixes
2726 ---------
2727
2728 - The static file response object used by ``config.add_static_view`` opened
2729   the static file twice, when it only needed to open it once.
2730
2731 - The AppendSlashNotFoundViewFactory used request.path to match routes.  This
2732   was wrong because request.path contains the script name, and this would
2733   cause it to fail in circumstances where the script name was not empty.  It
2734   should have used request.path_info, and now does.
2735
2736 Documentation
2737 -------------
2738
2739 - Updated the "Creating a Not Found View" section of the "Hooks" chapter,
2740   replacing explanations of registering a view using ``add_view`` or
2741   ``view_config`` with ones using ``add_notfound_view`` or
2742   ``notfound_view_config``.
2743
2744 - Updated the "Creating a Not Forbidden View" section of the "Hooks" chapter,
2745   replacing explanations of registering a view using ``add_view`` or
2746   ``view_config`` with ones using ``add_forbidden_view`` or
2747   ``forbidden_view_config``.
2748
2749 - Updated the "Redirecting to Slash-Appended Routes" section of the "URL
2750   Dispatch" chapter, replacing explanations of registering a view using
2751   ``add_view`` or ``view_config`` with ones using ``add_notfound_view`` or
2752   ``notfound_view_config``
2753
2754 - Updated all tutorials to use ``pyramid.view.forbidden_view_config`` rather
2755   than ``pyramid.view.view_config`` with an HTTPForbidden context.
2756
2757 1.3a8 (2012-02-19)
2758 ==================
2759
2760 Features
2761 --------
2762
2763 - The ``scan`` method of a ``Configurator`` can be passed an ``ignore``
2764   argument, which can be a string, a callable, or a list consisting of
2765   strings and/or callables.  This feature allows submodules, subpackages, and
2766   global objects from being scanned.  See
2767   http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for
2768   more information about how to use the ``ignore`` argument to ``scan``.
2769
2770 - Better error messages when a view callable returns a value that cannot be
2771   converted to a response (for example, when a view callable returns a
2772   dictionary without a renderer defined, or doesn't return any value at all).
2773   The error message now contains information about the view callable itself
2774   as well as the result of calling it.
2775
2776 - Better error message when a .pyc-only module is ``config.include`` -ed.
2777   This is not permitted due to error reporting requirements, and a better
2778   error message is shown when it is attempted.  Previously it would fail with
2779   something like "AttributeError: 'NoneType' object has no attribute
2780   'rfind'".
2781
2782 - Add ``pyramid.config.Configurator.add_traverser`` API method.  See the
2783   Hooks narrative documentation section entitled "Changing the Traverser" for
2784   more information.  This is not a new feature, it just provides an API for
2785   adding a traverser without needing to use the ZCA API.
2786
2787 - Add ``pyramid.config.Configurator.add_resource_url_adapter`` API method.
2788   See the Hooks narrative documentation section entitled "Changing How
2789   pyramid.request.Request.resource_url Generates a URL" for more information.
2790   This is not a new feature, it just provides an API for adding a resource
2791   url adapter without needing to use the ZCA API.
2792
2793 - The system value ``req`` is now supplied to renderers as an alias for
2794   ``request``.  This means that you can now, for example, in a template, do
2795   ``req.route_url(...)`` instead of ``request.route_url(...)``.  This is
2796   purely a change to reduce the amount of typing required to use request
2797   methods and attributes from within templates.  The value ``request`` is
2798   still available too, this is just an alternative.
2799
2800 - A new interface was added: ``pyramid.interfaces.IResourceURL``.  An adapter
2801   implementing its interface can be used to override resource URL generation
2802   when ``request.resource_url`` is called.  This interface replaces the
2803   now-deprecated ``pyramid.interfaces.IContextURL`` interface.
2804
2805 - The dictionary passed to a resource's ``__resource_url__`` method (see
2806   "Overriding Resource URL Generation" in the "Resources" chapter) now
2807   contains an ``app_url`` key, representing the application URL generated
2808   during ``request.resource_url``.  It represents a potentially customized
2809   URL prefix, containing potentially custom scheme, host and port information
2810   passed by the user to ``request.resource_url``.  It should be used instead
2811   of ``request.application_url`` where necessary.
2812
2813 - The ``request.resource_url`` API now accepts these arguments: ``app_url``,
2814   ``scheme``, ``host``, and ``port``.  The app_url argument can be used to
2815   replace the URL prefix wholesale during url generation.  The ``scheme``,
2816   ``host``, and ``port`` arguments can be used to replace the respective
2817   default values of ``request.application_url`` partially.
2818
2819 - A new API named ``request.resource_path`` now exists.  It works like
2820   ``request.resource_url`` but produces a relative URL rather than an
2821   absolute one.
2822
2823 - The ``request.route_url`` API now accepts these arguments: ``_app_url``,
2824   ``_scheme``, ``_host``, and ``_port``.  The ``_app_url`` argument can be
2825   used to replace the URL prefix wholesale during url generation.  The
2826   ``_scheme``, ``_host``, and ``_port`` arguments can be used to replace the
2827   respective default values of ``request.application_url`` partially.
2828
2829 Backwards Incompatibilities
2830 ---------------------------
2831
2832 - The ``pyramid.interfaces.IContextURL`` interface has been deprecated.
2833   People have been instructed to use this to register a resource url adapter
2834   in the "Hooks" chapter to use to influence ``request.resource_url`` URL
2835   generation for resources found via custom traversers since Pyramid 1.0.
2836
2837   The interface still exists and registering such an adapter still works, but
2838   this interface will be removed from the software after a few major Pyramid
2839   releases.  You should replace it with an equivalent
2840   ``pyramid.interfaces.IResourceURL`` adapter, registered using the new
2841   ``pyramid.config.Configurator.add_resource_url_adapter`` API.  A
2842   deprecation warning is now emitted when a
2843   ``pyramid.interfaces.IContextURL`` adapter is found when
2844   ``request.resource_url`` is called.
2845
2846 Documentation
2847 -------------
2848
2849 - Don't create a ``session`` instance in SQLA Wiki tutorial, use raw
2850   ``DBSession`` instead (this is more common in real SQLA apps).
2851
2852 Scaffolding
2853 -----------
2854
2855 - Put ``pyramid.includes`` targets within ini files in scaffolds on separate
2856   lines in order to be able to tell people to comment out only the
2857   ``pyramid_debugtoolbar`` line when they want to disable the toolbar.
2858
2859 Dependencies
2860 ------------
2861
2862 - Depend on ``venusian`` >= 1.0a3 to provide scan ``ignore`` support.
2863
2864 Internal
2865 --------
2866
2867 - Create a "MakoRendererFactoryHelper" that provides customizable settings
2868   key prefixes.  Allows settings prefixes other than "mako." to be used to
2869   create different factories that don't use the global mako settings.  This
2870   will be useful for the debug toolbar, which can currently be sabotaged by
2871   someone using custom mako configuration settings.
2872
2873 1.3a7 (2012-02-07)
2874 ==================
2875
2876 Features
2877 --------
2878
2879 - More informative error message when a ``config.include`` cannot find an
2880   ``includeme``.  See https://github.com/Pylons/pyramid/pull/392.
2881
2882 - Internal: catch unhashable discriminators early (raise an error instead of
2883   allowing them to find their way into resolveConflicts).
2884
2885 - The `match_param` view predicate now accepts a string or a tuple.
2886   This replaces the broken behavior of accepting a dict. See
2887   https://github.com/Pylons/pyramid/issues/425 for more information.
2888
2889 Bug Fixes
2890 ---------
2891
2892 - The process will now restart when ``pserve`` is used with the ``--reload``
2893   flag when the ``development.ini`` file (or any other .ini file in use) is
2894   changed.  See https://github.com/Pylons/pyramid/issues/377 and
2895   https://github.com/Pylons/pyramid/pull/411
2896
2897 - The ``prequest`` script would fail when used against URLs which did not
2898   return HTML or text.  See https://github.com/Pylons/pyramid/issues/381
2899
2900 Backwards Incompatibilities
2901 ---------------------------
2902
2903 - The `match_param` view predicate no longer accepts a dict. This will
2904   have no negative affect because the implementation was broken for
2905   dict-based arguments.
2906
2907 Documentation
2908 -------------
2909
2910 - Add a traversal hello world example to the narrative docs.
2911
2912 1.3a6 (2012-01-20)
2913 ==================
2914
2915 Features
2916 --------
2917
2918 - New API: ``pyramid.config.Configurator.set_request_property``. Add lazy
2919   property descriptors to a request without changing the request factory.
2920   This method provides conflict detection and is the suggested way to add
2921   properties to a request.
2922
2923 - Responses generated by Pyramid's ``static_view`` now use
2924   a ``wsgi.file_wrapper`` (see
2925   http://www.python.org/dev/peps/pep-0333/#optional-platform-specific-file-handling)
2926   when one is provided by the web server.
2927
2928 Bug Fixes
2929 ---------
2930
2931 - Views registered with an ``accept`` could not be overridden correctly with
2932   a different view that had the same predicate arguments.  See
2933   https://github.com/Pylons/pyramid/pull/404 for more information.
2934
2935 - When using a dotted name for a ``view`` argument to
2936   ``Configurator.add_view`` that pointed to a class with a ``view_defaults``
2937   decorator, the view defaults would not be applied.  See
2938   https://github.com/Pylons/pyramid/issues/396 .
2939
2940 - Static URL paths were URL-quoted twice.  See
2941   https://github.com/Pylons/pyramid/issues/407 .
2942
2943 1.3a5 (2012-01-09)
2944 ==================
2945
2946 Bug Fixes
2947 ---------
2948
2949 - The ``pyramid.view.view_defaults`` decorator did not work properly when
2950   more than one view relied on the defaults being different for configuration
2951   conflict resolution.  See https://github.com/Pylons/pyramid/issues/394.
2952
2953 Backwards Incompatibilities
2954 ---------------------------
2955
2956 - The ``path_info`` route and view predicates now match against
2957   ``request.upath_info`` (Unicode) rather than ``request.path_info``
2958   (indeterminate value based on Python 3 vs. Python 2).  This has to be done
2959   to normalize matching on Python 2 and Python 3.
2960
2961 1.3a4 (2012-01-05)
2962 ==================
2963
2964 Features
2965 --------
2966
2967 - New API: ``pyramid.request.Request.set_property``. Add lazy property
2968   descriptors to a request without changing the request factory. New
2969   properties may be reified, effectively caching the value for the lifetime
2970   of the instance. Common use-cases for this would be to get a database
2971   connection for the request or identify the current user.
2972
2973 - Use the ``waitress`` WSGI server instead of ``wsgiref`` in scaffolding.
2974
2975 Bug Fixes
2976 ---------
2977
2978 - The documentation of ``pyramid.events.subscriber`` indicated that using it
2979   as a decorator with no arguments like this::
2980
2981     @subscriber()
2982     def somefunc(event):
2983         pass
2984
2985   Would register ``somefunc`` to receive all events sent via the registry,
2986   but this was untrue.  Instead, it would receive no events at all.  This has
2987   now been fixed and the code matches the documentation.  See also
2988   https://github.com/Pylons/pyramid/issues/386
2989
2990 - Literal portions of route patterns were not URL-quoted when ``route_url``
2991   or ``route_path`` was used to generate a URL or path.
2992
2993 - The result of ``route_path`` or ``route_url`` might have been ``unicode``
2994   or ``str`` depending on the input.  It is now guaranteed to always be
2995   ``str``.
2996
2997 - URL matching when the pattern contained non-ASCII characters in literal
2998   parts was indeterminate.  Now the pattern supplied to ``add_route`` is
2999   assumed to be either: a ``unicode`` value, or a ``str`` value that contains
3000   only ASCII characters.  If you now want to match the path info from a URL
3001   that contains high order characters, you can pass the Unicode
3002   representation of the decoded path portion in the pattern.
3003
3004 - When using a ``traverse=`` route predicate, traversal would fail with a
3005   URLDecodeError if there were any high-order characters in the traversal
3006   pattern or in the matched dynamic segments.
3007
3008 - Using a dynamic segment named ``traverse`` in a route pattern like this::
3009
3010     config.add_route('trav_route', 'traversal/{traverse:.*}')
3011
3012   Would cause a ``UnicodeDecodeError`` when the route was matched and the
3013   matched portion of the URL contained any high-order characters.  See
3014   https://github.com/Pylons/pyramid/issues/385 .
3015
3016 - When using a ``*traverse`` stararg in a route pattern, a URL that matched
3017   that possessed a ``@@`` in its name (signifying a view name) would be
3018   inappropriately quoted by the traversal machinery during traversal,
3019   resulting in the view not being found properly. See
3020   https://github.com/Pylons/pyramid/issues/382 and
3021   https://github.com/Pylons/pyramid/issues/375 .
3022
3023 Backwards Incompatibilities
3024 ---------------------------
3025
3026 - String values passed to ``route_url`` or ``route_path`` that are meant to
3027   replace "remainder" matches will now be URL-quoted except for embedded
3028   slashes. For example::
3029
3030      config.add_route('remain', '/foo*remainder')
3031      request.route_path('remain', remainder='abc / def')
3032      # -> '/foo/abc%20/%20def'
3033
3034   Previously string values passed as remainder replacements were tacked on
3035   untouched, without any URL-quoting.  But this doesn't really work logically
3036   if the value passed is Unicode (raw unicode cannot be placed in a URL or in
3037   a path) and it is inconsistent with the rest of the URL generation
3038   machinery if the value is a string (it won't be quoted unless by the
3039   caller).
3040
3041   Some folks will have been relying on the older behavior to tack on query
3042   string elements and anchor portions of the URL; sorry, you'll need to
3043   change your code to use the ``_query`` and/or ``_anchor`` arguments to
3044   ``route_path`` or ``route_url`` to do this now.
3045
3046 - If you pass a bytestring that contains non-ASCII characters to
3047   ``add_route`` as a pattern, it will now fail at startup time.  Use Unicode
3048   instead.
3049
3050 1.3a3 (2011-12-21)
3051 ==================
3052
3053 Features
3054 --------
3055
3056 - Added a ``prequest`` script (along the lines of ``paster request``).  It is
3057   documented in the "Command-Line Pyramid" chapter in the section entitled
3058   "Invoking a Request".
3059
3060 - Add undocumented ``__discriminator__`` API to derived view callables.
3061   e.g. ``adapters.lookup(...).__discriminator__(context, request)``.  It will
3062   be used by superdynamic systems that require the discriminator to be used
3063   for introspection after manual view lookup.
3064
3065 Bug Fixes
3066 ---------
3067
3068 - Normalized exit values and ``-h`` output for all ``p*`` scripts
3069   (``pviews``, ``proutes``, etc).
3070
3071 Documentation
3072 -------------
3073
3074 - Added a section named "Making Your Script into a Console Script" in the
3075   "Command-Line Pyramid" chapter.
3076
3077 - Removed the "Running Pyramid on Google App Engine" tutorial from the main
3078   docs.  It survives on in the Cookbook
cd8ac8 3079   (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/deployment/gae.html).
2c949d 3080   Rationale: it provides the correct info for the Python 2.5 version of GAE
CM 3081   only, and this version of Pyramid does not support Python 2.5.
3082
3083 1.3a2 (2011-12-14)
3084 ==================
3085
3086 Features
3087 --------
3088
3089 - New API: ``pyramid.view.view_defaults``. If you use a class as a view, you
3090   can use the new ``view_defaults`` class decorator on the class to provide
3091   defaults to the view configuration information used by every
3092   ``@view_config`` decorator that decorates a method of that class.  It also
3093   works against view configurations involving a class made imperatively.
3094
3095 - Added a backwards compatibility knob to ``pcreate`` to emulate ``paster
3096   create`` handling for the ``--list-templates`` option.
3097
3098 - Changed scaffolding machinery around a bit to make it easier for people who
3099   want to have extension scaffolds that can work across Pyramid 1.0.X, 1.1.X,
3100   1.2.X and 1.3.X.  See the new "Creating Pyramid Scaffolds" chapter in the
3101   narrative documentation for more info.
3102
3103 Documentation
3104 -------------
3105
3106 - Added documentation to "View Configuration" narrative documentation chapter
3107   about ``view_defaults`` class decorator.
3108
3109 - Added API docs for ``view_defaults`` class decorator.
3110
3111 - Added an API docs chapter for ``pyramid.scaffolds``.
3112
3113 - Added a narrative docs chapter named "Creating Pyramid Scaffolds".
3114
3115 Backwards Incompatibilities
3116 ---------------------------
3117
3118 - The ``template_renderer`` method of ``pyramid.scaffolds.PyramidScaffold``
3119   was renamed to ``render_template``.  If you were overriding it, you're a
3120   bad person, because it wasn't an API before now.  But we're nice so we're
3121   letting you know.
3122
3123 1.3a1 (2011-12-09)
3124 ==================
3125
3126 Features
3127 --------
3128
3129 - Python 3.2 compatibility.
3130
3131 - New ``pyramid.compat`` module and API documentation which provides Python
3132   2/3 straddling support for Pyramid add-ons and development environments.
3133
3134 - A ``mako.directories`` setting is no longer required to use Mako templates
3135   Rationale: Mako template renderers can be specified using an absolute asset
3136   spec.  An entire application can be written with such asset specs,
3137   requiring no ordered lookup path.
3138
3139 - ``bpython`` interpreter compatibility in ``pshell``.  See the "Command-Line
3140   Pyramid" narrative docs chapter for more information.
3141
3142 - Added ``get_appsettings`` API function to the ``pyramid.paster`` module.
3143   This function returns the settings defined within an ``[app:...]`` section
3144   in a PasteDeploy ini file.
3145
3146 - Added ``setup_logging`` API function to the ``pyramid.paster`` module.
3147   This function sets up Python logging according to the logging configuration
3148   in a PasteDeploy ini file.
3149
3150 - Configuration conflict reporting is reported in a more understandable way
3151   ("Line 11 in file..." vs. a repr of a tuple of similar info).
3152
3153 - A configuration introspection system was added; see the narrative
3154   documentation chapter entitled "Pyramid Configuration Introspection" for
3155   more information.  New APIs: ``pyramid.registry.Introspectable``,
3156   ``pyramid.config.Configurator.introspector``,
3157   ``pyramid.config.Configurator.introspectable``,
3158   ``pyramid.registry.Registry.introspector``.
3159
3160 - Allow extra keyword arguments to be passed to the
3161   ``pyramid.config.Configurator.action`` method.
3162
3163 - New APIs: ``pyramid.path.AssetResolver`` and
3164   ``pyramid.path.DottedNameResolver``.  The former can be used to resolve
3165   asset specifications, the latter can be used to resolve dotted names to
3166   modules or packages.
3167
3168 Bug Fixes
3169 ---------
3170
3171 - Make test suite pass on 32-bit systems; closes #286.  closes #306.
3172   See also https://github.com/Pylons/pyramid/issues/286
3173
ef2a4a 3174 - The ``pyramid.view.view_config`` decorator did not accept a ``match_params``
2c949d 3175   predicate argument.  See https://github.com/Pylons/pyramid/pull/308
CM 3176
3177 - The AuthTktCookieHelper could potentially generate Unicode headers
3178   inappropriately when the ``tokens`` argument to remember was used.  See 
3179   https://github.com/Pylons/pyramid/pull/314.
3180
3181 - The AuthTktAuthenticationPolicy did not use a timing-attack-aware string
3182   comparator.  See https://github.com/Pylons/pyramid/pull/320 for more info.
3183
3184 - The DummySession in ``pyramid.testing`` now generates a new CSRF token if
3185   one doesn't yet exist.
3186
3187 - ``request.static_url`` now generates URL-quoted URLs when fed a ``path``
3188   argument which contains characters that are unsuitable for URLs.  See
3189   https://github.com/Pylons/pyramid/issues/349 for more info.
3190
3191 - Prevent a scaffold rendering from being named ``site`` (conflicts with
3192   Python internal site.py).
3193
3194 - Support for using instances as targets of the ``pyramid.wsgi.wsgiapp`` and
3195   ``pryramid.wsgi.wsgiapp2`` functions.
3196   See https://github.com/Pylons/pyramid/pull/370 for more info.
3197
3198 Backwards Incompatibilities
3199 ---------------------------
3200
3201 - Pyramid no longer runs on Python 2.5 (which includes the most recent
3202   release of Jython and the Python 2.5 version of GAE as of this writing).
3203
3204 - The ``paster`` command is no longer the documented way to create projects,
3205   start the server, or run debugging commands.  To create projects from
3206   scaffolds, ``paster create`` is replaced by the ``pcreate`` console script.
3207   To serve up a project, ``paster serve`` is replaced by the ``pserve``
3208   console script.  New console scripts named ``pshell``, ``pviews``,
3209   ``proutes``, and ``ptweens`` do what their ``paster <commandname>``
3210   equivalents used to do.  Rationale: the Paste and PasteScript packages do
3211   not run under Python 3.
3212
3213 - The default WSGI server run as the result of ``pserve`` from newly rendered
3214   scaffolding is now the ``wsgiref`` WSGI server instead of the
3215   ``paste.httpserver`` server.  Rationale: Rationale: the Paste and
3216   PasteScript packages do not run under Python 3.
3217
3218 - The ``pshell`` command (see "paster pshell") no longer accepts a
3219   ``--disable-ipython`` command-line argument.  Instead, it accepts a ``-p``
3220   or ``--python-shell`` argument, which can be any of the values ``python``,
3221   ``ipython`` or ``bpython``.
3222
3223 - Removed the ``pyramid.renderers.renderer_from_name`` function.  It has been
3224   deprecated since Pyramid 1.0, and was never an API.
3225
3226 - To use ZCML with versions of Pyramid >= 1.3, you will need ``pyramid_zcml``
3227   version >= 0.8 and ``zope.configuration`` version >= 3.8.0.  The
3228   ``pyramid_zcml`` package version 0.8 is backwards compatible all the way to
3229   Pyramid 1.0, so you won't be warned if you have older versions installed
3230   and upgrade Pyramid "in-place"; it may simply break instead.
3231
3232 Dependencies
3233 ------------
3234
3235 - Pyramid no longer depends on the ``zope.component`` package, except as a
3236   testing dependency.
3237
3238 - Pyramid now depends on a zope.interface>=3.8.0, WebOb>=1.2dev,
3239   repoze.lru>=0.4, zope.deprecation>=3.5.0, translationstring>=0.4 (for
3240   Python 3 compatibility purposes).  It also, as a testing dependency,
3241   depends on WebTest>=1.3.1 for the same reason.
3242
3243 - Pyramid no longer depends on the Paste or PasteScript packages.
3244
3245 Documentation
3246 -------------
3247
3248 - The SQLAlchemy Wiki tutorial has been updated.  It now uses
3249   ``@view_config`` decorators and an explicit database population script.
3250
3251 - Minor updates to the ZODB Wiki tutorial.
3252
3253 - A narrative documentation chapter named "Extending Pyramid Configuration"
3254   was added; it describes how to add a new directive, and how use the
3255   ``pyramid.config.Configurator.action`` method within custom directives.  It
3256   also describes how to add introspectable objects.
3257
3258 - A narrative documentation chapter named "Pyramid Configuration
3259   Introspection" was added.  It describes how to query the introspection
3260   system.
3261
3262 Scaffolds
3263 ---------
3264
3265 - Rendered scaffolds have now been changed to be more relocatable (fewer
3266   mentions of the package name within files in the package).
3267
3268 - The ``routesalchemy`` scaffold has been renamed ``alchemy``, replacing the
3269   older (traversal-based) ``alchemy`` scaffold (which has been retired).
3270
3271 - The ``starter`` scaffold now uses URL dispatch by default.
3272
e04cbb 3273 1.2 (2011-09-12)
CM 3274 ================
3275
3276 Features
3277 --------
3278
3279 - Route pattern replacement marker names can now begin with an underscore.
3280   See https://github.com/Pylons/pyramid/issues/276.
3281
3282 1.2b3 (2011-09-11)
3283 ==================
3284
3285 Bug Fixes
3286 ---------
3287
3288 - The route prefix was not taken into account when a static view was added in
3289   an "include".  See https://github.com/Pylons/pyramid/issues/266 .
3290
3291 1.2b2 (2011-09-08)
3292 ==================
3293
3294 Bug Fixes
3295 ---------
3296
3297 - The 1.2b1 tarball was a brownbag (particularly for Windows users) because
3298   it contained filenames with stray quotation marks in inappropriate places.
3299   We depend on ``setuptools-git`` to produce release tarballs, and when it
3300   was run to produce the 1.2b1 tarball, it didn't yet cope well with files
3301   present in git repositories with high-order characters in their filenames.
3302
3303 Documentation
3304 -------------
3305
3306 - Minor tweaks to the "Introduction" narrative chapter example app and
3307   wording.
3308
3309 1.2b1 (2011-09-08)
3310 ==================
3311
3312 Bug Fixes
3313 ---------
3314
3315 - Sometimes falling back from territory translations (``de_DE``) to language
3316   translations (``de``) would not work properly when using a localizer.  See
3317   https://github.com/Pylons/pyramid/issues/263
3318
3319 - The static file serving machinery could not serve files that started with a
3320   ``.`` (dot) character.
3321
3322 - Static files with high-order (super-ASCII) characters in their names could
3323   not be served by a static view.  The static file serving machinery
3324   inappropriately URL-quoted path segments in filenames when asking for files
3325   from the filesystem.
3326
3327 - Within ``pyramid.traversal.traversal_path`` , canonicalize URL segments
3328   from UTF-8 to Unicode before checking whether a segment matches literally
3329   one of ``.``, the empty string, or ``..`` in case there's some sneaky way
3330   someone might tunnel those strings via UTF-8 that don't match the literals
3331   before decoded.
3332
3333 Documentation
3334 -------------
3335
3336 - Added a "What Makes Pyramid Unique" section to the Introduction narrative
3337   chapter.
3338
3339 1.2a6 (2011-09-06)
3340 ==================
3341
3342 Bug Fixes
3343 ---------
3344
3345 - AuthTktAuthenticationPolicy with a ``reissue_time`` interfered with logout.
3346   See https://github.com/Pylons/pyramid/issues/262.
3347
3348 Internal
3349 --------
3350
3351 - Internalize code previously depended upon as imports from the
3352   ``paste.auth`` module (futureproof).
3353
3354 - Replaced use of ``paste.urlparser.StaticURLParser`` with a derivative of
3355   Chris Rossi's "happy" static file serving code (futureproof).
3356
3357 - Fixed test suite; on some systems tests would fail due to indeterminate
3358   test run ordering and a double-push-single-pop of a shared test variable.
3359
3360 Behavior Differences
3361 --------------------
3362
3363 - An ETag header is no longer set when serving a static file.  A
3364   Last-Modified header is set instead.
3365
3366 - Static file serving no longer supports the ``wsgi.file_wrapper`` extension.
3367
3368 - Instead of returning a ``403 Forbidden`` error when a static file is served
3369   that cannot be accessed by the Pyramid process' user due to file
3370   permissions, an IOError (or similar) will be raised.
3371
3372 Scaffolds
3373 ---------
3374
3375 - All scaffolds now send the ``cache_max_age`` parameter to the
3376   ``add_static_view`` method.
3377
3378 1.2a5 (2011-09-04)
3379 ==================
3380
3381 Bug Fixes
3382 ---------
3383
3384 - The ``route_prefix`` of a configurator was not properly taken into account
3385   when registering routes in certain circumstances.  See
3386   https://github.com/Pylons/pyramid/issues/260
3387
3388 Dependencies
3389 ------------
3390
3391 - The ``zope.configuration`` package is no longer a dependency.
3392
3393 1.2a4 (2011-09-02)
3394 ==================
3395
3396 Features
3397 --------
3398
3399 - Support an ``onerror`` keyword argument to
3400   ``pyramid.config.Configurator.scan()``.  This onerror keyword argument is
3401   passed to ``venusian.Scanner.scan()`` to influence error behavior when
3402   an exception is raised during scanning.
3403
3404 - The ``request_method`` predicate argument to
3405   ``pyramid.config.Configurator.add_view`` and
3406   ``pyramid.config.Configurator.add_route`` is now permitted to be a tuple of
3407   HTTP method names.  Previously it was restricted to being a string
3408   representing a single HTTP method name.
3409
3410 - Undeprecated ``pyramid.traversal.find_model``,
3411   ``pyramid.traversal.model_path``, ``pyramid.traversal.model_path_tuple``,
3412   and ``pyramid.url.model_url``, which were all deprecated in Pyramid 1.0.
3413   There's just not much cost to keeping them around forever as aliases to
3414   their renamed ``resource_*`` prefixed functions.
3415
3416 - Undeprecated ``pyramid.view.bfg_view``, which was deprecated in Pyramid
3417   1.0.  This is a low-cost alias to ``pyramid.view.view_config`` which we'll
3418   just keep around forever.
3419
3420 Dependencies
3421 ------------
3422
3423 - Pyramid now requires Venusian 1.0a1 or better to support the ``onerror``
3424   keyword argument to ``pyramid.config.Configurator.scan``.
3425
3426 1.2a3 (2011-08-29)
3427 ==================
3428
3429 Bug Fixes
3430 ---------
3431
3432 - Pyramid did not properly generate static URLs using
3433   ``pyramid.url.static_url`` when passed a caller-package relative path due
3434   to a refactoring done in 1.2a1.
3435
3436 - The ``settings`` object emitted a deprecation warning any time
3437   ``__getattr__`` was called upon it.  However, there are legitimate
3438   situations in which ``__getattr__`` is called on arbitrary objects
3439   (e.g. ``hasattr``).  Now, the ``settings`` object only emits the warning
3440   upon successful lookup.
3441
3442 Internal
3443 --------
3444
3445 - Use ``config.with_package`` in view_config decorator rather than
3446   manufacturing a new renderer helper (cleanup).
3447
3448 1.2a2 (2011-08-27)
3449 ==================
3450
3451 Bug Fixes
3452 ---------
3453
3454 - When a ``renderers=`` argument is not specified to the Configurator
3455   constructor, eagerly register and commit the default renderer set.  This
3456   permits the overriding of the default renderers, which was broken in 1.2a1
3457   without a commit directly after Configurator construction.
3458
3459 - Mako rendering exceptions had the wrong value for an error message.
3460
3461 - An include could not set a root factory successfully because the
3462   Configurator constructor unconditionally registered one that would be
3463   treated as if it were "the word of the user".
3464
3465 Features
3466 --------
3467
3468 - A session factory can now be passed in using the dotted name syntax.
3469
3470 1.2a1 (2011-08-24)
3471 ==================
3472
3473 Features
3474 --------
3475
3476 - The ``[pshell]`` section in an ini configuration file now treats a
3477   ``setup`` key as a dotted name that points to a callable that is passed the
3478   bootstrap environment.  It can mutate the environment as necessary for
3479   great justice.
3480
3481 - A new configuration setting named ``pyramid.includes`` is now available.
3482   It is described in the "Environment Variables and ``.ini`` Files Settings"
3483   narrative documentation chapter.
3484
3485 - Added a ``route_prefix`` argument to the
3486   ``pyramid.config.Configurator.include`` method.  This argument allows you
3487   to compose URL dispatch applications together.  See the section entitled
3488   "Using a Route Prefix to Compose Applications" in the "URL Dispatch"
3489   narrative documentation chapter.
3490
3491 - Added a ``pyramid.security.NO_PERMISSION_REQUIRED`` constant for use in
3492   ``permission=`` statements to view configuration.  This constant has a
3493   value of the string ``__no_permission_required__``.  This string value was
3494   previously referred to in documentation; now the documentation uses the
3495   constant.
3496
3497 - Added a decorator-based way to configure a response adapter:
3498   ``pyramid.response.response_adapter``.  This decorator has the same use as
3499   ``pyramid.config.Configurator.add_response_adapter`` but it's declarative.
3500
3501 - The ``pyramid.events.BeforeRender`` event now has an attribute named
3502   ``rendering_val``.  This can be used to introspect the value returned by a
3503   view in a BeforeRender subscriber.
3504
3505 - New configurator directive: ``pyramid.config.Configurator.add_tween``.
3506   This directive adds a "tween".  A "tween" is used to wrap the Pyramid
3507   router's primary request handling function.  This is a feature may be used
3508   by Pyramid framework extensions, to provide, for example, view timing
3509   support and as a convenient place to hang bookkeeping code.
3510
3511   Tweens are further described in the narrative docs section in the Hooks
3512   chapter, named "Registering Tweens".
3513
3514 - New paster command ``paster ptweens``, which prints the current "tween"
3515   configuration for an application.  See the section entitled "Displaying
3516   Tweens" in the Command-Line Pyramid chapter of the narrative documentation
3517   for more info.
3518
3519 - The Pyramid debug logger now uses the standard logging configuration
3520   (usually set up by Paste as part of startup).  This means that output from
3521   e.g. ``debug_notfound``, ``debug_authorization``, etc. will go to the
3522   normal logging channels.  The logger name of the debug logger will be the
3523   package name of the *caller* of the Configurator's constructor.
3524
3525 - A new attribute is available on request objects: ``exc_info``.  Its value
3526   will be ``None`` until an exception is caught by the Pyramid router, after
3527   which it will be the result of ``sys.exc_info()``.
3528
3529 - ``pyramid.testing.DummyRequest`` now implements the
3530   ``add_finished_callback`` and ``add_response_callback`` methods.
3531
3532 - New methods of the ``pyramid.config.Configurator`` class:
3533   ``set_authentication_policy`` and ``set_authorization_policy``.  These are
3534   meant to be consumed mostly by add-on authors.
3535
3536 - New Configurator method: ``set_root_factory``.
3537
3538 - Pyramid no longer eagerly commits some default configuration statements at
3539   Configurator construction time, which permits values passed in as
3540   constructor arguments (e.g. ``authentication_policy`` and
3541   ``authorization_policy``) to override the same settings obtained via an
3542   "include".
3543
3544 - Better Mako rendering exceptions via
3545   ``pyramid.mako_templating.MakoRenderingException``
3546
3547 - New request methods: ``current_route_url``, ``current_route_path``, and
3548   ``static_path``.
3549
3550 - New functions in ``pyramid.url``: ``current_route_path`` and
3551   ``static_path``.
3552
3553 - The ``pyramid.request.Request.static_url`` API (and its brethren
3554   ``pyramid.request.Request.static_path``, ``pyramid.url.static_url``, and
3555   ``pyramid.url.static_path``) now accept an asbolute filename as a "path"
3556   argument.  This will generate a URL to an asset as long as the filename is
3557   in a directory which was previously registered as a static view.
3558   Previously, trying to generate a URL to an asset using an absolute file
3559   path would raise a ValueError.
3560
3561 - The ``RemoteUserAuthenticationPolicy ``, ``AuthTktAuthenticationPolicy``,
3562   and ``SessionAuthenticationPolicy`` constructors now accept an additional
3563   keyword argument named ``debug``.  By default, this keyword argument is
3564   ``False``.  When it is ``True``, debug information will be sent to the
3565   Pyramid debug logger (usually on stderr) when the ``authenticated_userid``
3566   or ``effective_principals`` method is called on any of these policies.  The
3567   output produced can be useful when trying to diagnose
3568   authentication-related problems.
3569
3570 - New view predicate: ``match_param``.  Example: a view added via
3571   ``config.add_view(aview, match_param='action=edit')`` will be called only
3572   when the ``request.matchdict`` has a value inside it named ``action`` with
3573   a value of ``edit``.
3574
3575 Internal
3576 --------
3577
3578 - The Pyramid "exception view" machinery is now implemented as a "tween"
3579   (``pyramid.tweens.excview_tween_factory``).
3580
3581 - WSGIHTTPException (HTTPFound, HTTPNotFound, etc) now has a new API named
3582   "prepare" which renders the body and content type when it is provided with
3583   a WSGI environ.  Required for debug toolbar.
3584
3585 - Once ``__call__`` or ``prepare`` is called on a WSGIHTTPException, the body
3586   will be set, and subsequent calls to ``__call__`` will always return the
3587   same body.  Delete the body attribute to rerender the exception body.
3588
3589 - Previously the ``pyramid.events.BeforeRender`` event *wrapped* a dictionary
3590   (it addressed it as its ``_system`` attribute).  Now it *is* a dictionary
3591   (it inherits from ``dict``), and it's the value that is passed to templates
3592   as a top-level dictionary.
3593
3594 - The ``route_url``, ``route_path``, ``resource_url``, ``static_url``, and
3595   ``current_route_url`` functions in the ``pyramid.url`` package now delegate
3596   to a method on the request they've been passed, instead of the other way
3597   around.  The pyramid.request.Request object now inherits from a mixin named
3598   pyramid.url.URLMethodsMixin to make this possible, and all url/path
3599   generation logic is embedded in this mixin.
3600
3601 - Refactor ``pyramid.config`` into a package.
3602
3603 - Removed the ``_set_security_policies`` method of the Configurator.
3604
3605 - Moved the ``StaticURLInfo`` class from ``pyramid.static`` to
3606   ``pyramid.config.views``.
3607
3608 - Move the ``Settings`` class from ``pyramid.settings`` to
3609   ``pyramid.config.settings``.
3610
3611 - Move the ``OverrideProvider``, ``PackageOverrides``, ``DirectoryOverride``,
3612   and ``FileOverride`` classes from ``pyramid.asset`` to
3613   ``pyramid.config.assets``.
3614
3615 Deprecations
3616 ------------
3617
3618 - All Pyramid-related deployment settings (e.g. ``debug_all``,
3619   ``debug_notfound``) are now meant to be prefixed with the prefix
3620   ``pyramid.``.  For example: ``debug_all`` -> ``pyramid.debug_all``.  The
3621   old non-prefixed settings will continue to work indefinitely but supplying
3622   them may eventually print a deprecation warning.  All scaffolds and
3623   tutorials have been changed to use prefixed settings.
3624
3625 - The ``settings`` dictionary now raises a deprecation warning when you
3626   attempt to access its values via ``__getattr__`` instead of
3627   via ``__getitem__``.
3628
3629 Backwards Incompatibilities
3630 ---------------------------
3631
3632 - If a string is passed as the ``debug_logger`` parameter to a Configurator,
3633   that string is considered to be the name of a global Python logger rather
3634   than a dotted name to an instance of a logger.
3635
3636 - The ``pyramid.config.Configurator.include`` method now accepts only a
3637   single ``callable`` argument (a sequence of callables used to be
3638   permitted).  If you are passing more than one ``callable`` to
3639   ``pyramid.config.Configurator.include``, it will break.  You now must now
3640   instead make a separate call to the method for each callable.  This change
3641   was introduced to support the ``route_prefix`` feature of include.
3642
3643 - It may be necessary to more strictly order configuration route and view
3644   statements when using an "autocommitting" Configurator.  In the past, it
3645   was possible to add a view which named a route name before adding a route
3646   with that name when you used an autocommitting configurator.  For example::
3647
3648     config = Configurator(autocommit=True)
3649     config.add_view('my.pkg.someview', route_name='foo')
3650     config.add_route('foo', '/foo')
3651
3652   The above will raise an exception when the view attempts to add itself.
3653   Now you must add the route before adding the view::
3654
3655     config = Configurator(autocommit=True)
3656     config.add_route('foo', '/foo')
3657     config.add_view('my.pkg.someview', route_name='foo')
3658
3659   This won't effect "normal" users, only people who have legacy BFG codebases
3660   that used an autommitting configurator and possibly tests that use the
3661   configurator API (the configurator returned by ``pyramid.testing.setUp`` is
3662   an autocommitting configurator).  The right way to get around this is to
3663   use a non-autocommitting configurator (the default), which does not have
3664   these directive ordering requirements.
3665
3666 - The ``pyramid.config.Configurator.add_route`` directive no longer returns a
3667   route object.  This change was required to make route vs. view
3668   configuration processing work properly.
3669
3670 Documentation
3671 -------------
3672
3673 - Narrative and API documentation which used the ``route_url``,
3674   ``route_path``, ``resource_url``, ``static_url``, and ``current_route_url``
3675   functions in the ``pyramid.url`` package have now been changed to use
3676   eponymous methods of the request instead.
3677
3678 - Added a section entitled "Using a Route Prefix to Compose Applications" to
3679   the "URL Dispatch" narrative documentation chapter.
3680
3681 - Added a new module to the API docs: ``pyramid.tweens``.
3682
3683 - Added a "Registering Tweens" section to the "Hooks" narrative chapter.
3684
3685 - Added a "Displaying Tweens" section to the "Command-Line Pyramid" narrative
3686   chapter.
3687
3688 - Added documentation for the ``pyramid.tweens`` and ``pyramid.includes``
3689   configuration settings to the "Environment Variables and ``.ini`` Files
3690   Settings" chapter.
3691
3692 - Added a Logging chapter to the narrative docs (based on the Pylons logging
3693   docs, thanks Phil).
3694
3695 - Added a Paste chapter to the narrative docs (moved content from the Project
3696   chapter).
3697
3698 - Added the ``pyramid.interfaces.IDict`` interface representing the methods
3699   of a dictionary, for documentation purposes only (IMultiDict and
3700   IBeforeRender inherit from it).
3701
3702 - All tutorials now use - The ``route_url``, ``route_path``,
3703   ``resource_url``, ``static_url``, and ``current_route_url`` methods of the
3704   request rather than the function variants imported from ``pyramid.url``.
3705
3706 - The ZODB wiki tutorial now uses the ``pyramid_zodbconn`` package rather
3707   than the ``repoze.zodbconn`` package to provide ZODB integration.
3708
3709 Dependency Changes
3710 ------------------
3711
3712 - Pyramid now relies on PasteScript >= 1.7.4.  This version contains a
3713   feature important for allowing flexible logging configuration.
3714
3715 Scaffolds
3716 ----------
3717
3718 - All scaffolds now use the ``pyramid_tm`` package rather than the
3719   ``repoze.tm2`` middleware to manage transaction management.
3720
3721 - The ZODB scaffold now uses the ``pyramid_zodbconn`` package rather than the
3722   ``repoze.zodbconn`` package to provide ZODB integration.
3723
3724 - All scaffolds now use the ``pyramid_debugtoolbar`` package rather than the
3725   ``WebError`` package to provide interactive debugging features.
3726
3727 - Projects created via a scaffold no longer depend on the ``WebError``
3728   package at all; configuration in the ``production.ini`` file which used to
3729   require its ``error_catcher`` middleware has been removed.  Configuring
3730   error catching / email sending is now the domain of the ``pyramid_exclog``
cd8ac8 3731   package (see http://docs.pylonsproject.org/projects/pyramid_exclog/en/latest/).
e04cbb 3732
CM 3733 Bug Fixes
3734 ---------
3735
3736 - Fixed an issue with the default renderer not working at certain times.  See
3737   https://github.com/Pylons/pyramid/issues/249
3738
3739
bd9947 3740 1.1 (2011-07-22)
CM 3741 ================
3742
3743 Features
3744 --------
3745
3746 - Added the ``pyramid.renderers.null_renderer`` object as an API.  The null
3747   renderer is an object that can be used in advanced integration cases as
3748   input to the view configuration ``renderer=`` argument.  When the null
3749   renderer is used as a view renderer argument, Pyramid avoids converting the
3750   view callable result into a Response object.  This is useful if you want to
3751   reuse the view configuration and lookup machinery outside the context of
3752   its use by the Pyramid router.  This feature was added for consumption by
3753   the ``pyramid_rpc`` package, which uses view configuration and lookup
3754   outside the context of a router in exactly this way.  ``pyramid_rpc`` has
3755   been broken under 1.1 since 1.1b1; adding it allows us to make it work
3756   again.
3757
3758 - Change all scaffolding templates that point to docs.pylonsproject.org to
3759   use ``/projects/pyramid/current`` rather than ``/projects/pyramid/dev``.
3760
3761 Internals
3762 ---------
3763
3764 - Remove ``compat`` code that served only the purpose of providing backwards
3765   compatibility with Python 2.4.
3766
3767 - Add a deprecation warning for non-API function
3768   ``pyramid.renderers.renderer_from_name`` which has seen use in the wild.
3769
3770 - Add a ``clone`` method to ``pyramid.renderers.RendererHelper`` for use by
3771   the ``pyramid.view.view_config`` decorator.
3772
3773 Documentation
3774 -------------
3775
3776 - Fixed two typos in wiki2 (SQLA + URL Dispatch) tutorial.
3777
3778 - Reordered chapters in narrative section for better new user friendliness.
3779
3780 - Added more indexing markers to sections in documentation.
3781
3782 1.1b4 (2011-07-18)
3783 ==================
3784
3785 Documentation
3786 -------------
3787
3788 - Added a section entitled "Writing a Script" to the "Command-Line Pyramid"
3789   chapter.
3790
3791 Backwards Incompatibilities
3792 ---------------------------
3793
3794 - We added the ``pyramid.scripting.make_request`` API too hastily in 1.1b3.
3795   It has been removed.  Sorry for any inconvenience.  Use the
3796   ``pyramid.request.Request.blank`` API instead.
3797
3798 Features
3799 --------
3800
3801 - The ``paster pshell``, ``paster pviews``, and ``paster proutes`` commands
3802   each now under the hood uses ``pyramid.paster.bootstrap``, which makes it
3803   possible to supply an ``.ini`` file without naming the "right" section in
3804   the file that points at the actual Pyramid application.  Instead, you can
3805   generally just run ``paster {pshell|proutes|pviews} development.ini`` and
3806   it will do mostly the right thing.
3807
3808 Bug Fixes
3809 ---------
3810
3811 - Omit custom environ variables when rendering a custom exception template in
3812   ``pyramid.httpexceptions.WSGIHTTPException._set_default_attrs``;
3813   stringifying thse may trigger code that should not be executed; see
3814   https://github.com/Pylons/pyramid/issues/239
3815
3816 1.1b3 (2011-07-15)
3817 ==================
3818
3819 Features
3820 --------
3821
3822 - Fix corner case to ease semifunctional testing of views: create a new
3823   rendererinfo to clear out old registry on a rescan.  See
3824   https://github.com/Pylons/pyramid/pull/234.
3825
3826 - New API class: ``pyramid.static.static_view``.  This supersedes the
3827   deprecated ``pyramid.view.static`` class.  ``pyramid.static.static_view``
3828   by default serves up documents as the result of the request's
3829   ``path_info``, attribute rather than it's ``subpath`` attribute (the
3830   inverse was true of ``pyramid.view.static``, and still is).
3831   ``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when
3832   you want the static view to behave like the older deprecated version.
3833
3834 - A new API function ``pyramid.paster.bootstrap`` has been added to make
3835   writing scripts that bootstrap a Pyramid environment easier, e.g.::
3836
3837       from pyramid.paster import bootstrap
3838       info = bootstrap('/path/to/my/development.ini')
3839       request = info['request']
3840       print request.route_url('myroute')
3841
3842 - A new API function ``pyramid.scripting.prepare`` has been added.  It is a
3843   lower-level analogue of ``pyramid.paster.boostrap`` that accepts a request
3844   and a registry instead of a config file argument, and is used for the same
3845   purpose::
3846
3847       from pyramid.scripting import prepare
3848       info = prepare(registry=myregistry)
3849       request = info['request']
3850       print request.route_url('myroute')
3851
3852 - A new API function ``pyramid.scripting.make_request`` has been added.  The
3853   resulting request will have a ``registry`` attribute.  It is meant to be
3854   used in conjunction with ``pyramid.scripting.prepare`` and/or
3855   ``pyramid.paster.bootstrap`` (both of which accept a request as an
3856   argument)::
3857
3858       from pyramid.scripting import make_request
3859       request = make_request('/')
3860
3861 - New API attribute ``pyramid.config.global_registries`` is an iterable
3862   object that contains references to every Pyramid registry loaded into the
3863   current process via ``pyramid.config.Configurator.make_app``.  It also has
3864   a ``last`` attribute containing the last registry loaded.  This is used by
3865   the scripting machinery, and is available for introspection.
3866
3867 Deprecations
3868 ------------
3869
3870 - The ``pyramid.view.static`` class has been deprecated in favor of the newer
3871   ``pyramid.static.static_view`` class.  A deprecation warning is raised when
3872   it is used.  You should replace it with a reference to
3873   ``pyramid.static.static_view`` with the ``use_subpath=True`` argument.
3874
3875 Bug Fixes
3876 ---------
3877
3878 - Without a mo-file loaded for the combination of domain/locale,
3879   ``pyramid.i18n.Localizer.pluralize`` run using that domain/locale
3880   combination raised an inscrutable "translations object has no attr
3881   'plural'" error.  Now, instead it "works" (it uses a germanic pluralization
3882   by default).  It's nonsensical to try to pluralize something without
3883   translations for that locale/domain available, but this behavior matches
3884   the behavior of ``pyramid.i18n.Localizer.translate`` so it's at least
3885   consistent; see https://github.com/Pylons/pyramid/issues/235.
3886
3887 1.1b2 (2011-07-13)
3888 ==================
3889
3890 Features
3891 --------
3892
3893 - New environment setting ``PYRAMID_PREVENT_HTTP_CACHE`` and new
3894   configuration file value ``prevent_http_cache``.  These are synomymous and
3895   allow you to prevent HTTP cache headers from being set by Pyramid's
3896   ``http_cache`` machinery globally in a process.  see the "Influencing HTTP
3897   Caching" section of the "View Configuration" narrative chapter and the
3898   detailed documentation for this setting in the "Environment Variables and
3899   Configuration Settings" narrative chapter.
3900
3901 Behavior Changes
3902 ----------------
3903
3904 - Previously, If a ``BeforeRender`` event subscriber added a value via the
3905   ``__setitem__`` or ``update`` methods of the event object with a key that
3906   already existed in the renderer globals dictionary, a ``KeyError`` was
3907   raised.  With the deprecation of the "add_renderer_globals" feature of the
3908   configurator, there was no way to override an existing value in the
3909   renderer globals dictionary that already existed.  Now, the event object
3910   will overwrite an older value that is already in the globals dictionary
3911   when its ``__setitem__`` or ``update`` is called (as well as the new
3912   ``setdefault`` method), just like a plain old dictionary.  As a result, for
3913   maximum interoperability with other third-party subscribers, if you write
3914   an event subscriber meant to be used as a BeforeRender subscriber, your
3915   subscriber code will now need to (using ``.get`` or ``__contains__`` of the
3916   event object) ensure no value already exists in the renderer globals
3917   dictionary before setting an overriding value.
3918
3919 Bug Fixes
3920 ---------
3921
3922 - The ``Configurator.add_route`` method allowed two routes with the same
3923   route to be added without an intermediate ``config.commit()``.  If you now
3924   receive a ``ConfigurationError`` at startup time that appears to be
3925   ``add_route`` related, you'll need to either a) ensure that all of your
3926   route names are unique or b) call ``config.commit()`` before adding a
3927   second route with the name of a previously added name or c) use a
3928   Configurator that works in ``autocommit`` mode.
3929
3930 - The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` scaffolds
3931   inappropriately used ``DBSession.rollback()`` instead of
3932   ``transaction.abort()`` in one place.
3933
3934 - We now clear ``request.response`` before we invoke an exception view; an
3935   exception view will be working with a request.response that has not been
3936   touched by any code prior to the exception.
3937
3938 - Views associated with routes with spaces in the route name may not have
3939   been looked up correctly when using Pyramid with ``zope.interface`` 3.6.4
3940   and better.  See https://github.com/Pylons/pyramid/issues/232.
3941
3942 Documentation
3943 -------------
3944
3945 - Wiki2 (SQLAlchemy + URL Dispatch) tutorial ``models.initialize_sql`` didn't
3946   match the ``pyramid_routesalchemy`` scaffold function of the same name; it
3947   didn't get synchronized when it was changed in the scaffold.
3948
3949 - New documentation section in View Configuration narrative chapter:
3950   "Influencing HTTP Caching".
3951
3952 1.1b1 (2011-07-10)
3953 ==================
3954
3955 Features
3956 --------
3957
3958 - It is now possible to invoke ``paster pshell`` even if the paste ini file
3959   section name pointed to in its argument is not actually a Pyramid WSGI
3960   application.  The shell will work in a degraded mode, and will warn the
3961   user.  See "The Interactive Shell" in the "Creating a Pyramid Project"
3962   narrative documentation section.
3963
3964 - ``paster pshell`` now offers more built-in global variables by default
3965   (including ``app`` and ``settings``).  See "The Interactive Shell" in the
3966   "Creating a Pyramid Project" narrative documentation section.
3967
3968 - It is now possible to add a ``[pshell]`` section to your application's .ini
3969   configuration file, which influences the global names available to a pshell
3970   session.  See "Extending the Shell" in the "Creating a Pyramid Project"
3971   narrative documentation chapter.
3972
3973 - The ``config.scan`` method has grown a ``**kw`` argument.  ``kw`` argument
3974   represents a set of keyword arguments to pass to the Venusian ``Scanner``
3975   object created by Pyramid.  (See the Venusian documentation for more
3976   information about ``Scanner``).
3977
3978 - New request property: ``json_body``. This property will return the
3979   JSON-decoded variant of the request body.  If the request body is not
3980   well-formed JSON, this property will raise an exception.
3981
3982 - A new value ``http_cache`` can be used as a view configuration
3983   parameter.
3984
3985   When you supply an ``http_cache`` value to a view configuration, the
3986   ``Expires`` and ``Cache-Control`` headers of a response generated by the
3987   associated view callable are modified.  The value for ``http_cache`` may be
3988   one of the following:
3989
3990   - A nonzero integer.  If it's a nonzero integer, it's treated as a number
3991     of seconds.  This number of seconds will be used to compute the
3992     ``Expires`` header and the ``Cache-Control: max-age`` parameter of
3993     responses to requests which call this view.  For example:
3994     ``http_cache=3600`` instructs the requesting browser to 'cache this
3995     response for an hour, please'.
3996
3997   - A ``datetime.timedelta`` instance.  If it's a ``datetime.timedelta``
3998     instance, it will be converted into a number of seconds, and that number
3999     of seconds will be used to compute the ``Expires`` header and the
4000     ``Cache-Control: max-age`` parameter of responses to requests which call
4001     this view.  For example: ``http_cache=datetime.timedelta(days=1)``
4002     instructs the requesting browser to 'cache this response for a day,
4003     please'.
4004
4005   - Zero (``0``).  If the value is zero, the ``Cache-Control`` and
4006     ``Expires`` headers present in all responses from this view will be
4007     composed such that client browser cache (and any intermediate caches) are
4008     instructed to never cache the response.
4009
4010   - A two-tuple.  If it's a two tuple (e.g. ``http_cache=(1,
4011     {'public':True})``), the first value in the tuple may be a nonzero
4012     integer or a ``datetime.timedelta`` instance; in either case this value
4013     will be used as the number of seconds to cache the response.  The second
4014     value in the tuple must be a dictionary.  The values present in the
4015     dictionary will be used as input to the ``Cache-Control`` response
4016     header.  For example: ``http_cache=(3600, {'public':True})`` means 'cache
4017     for an hour, and add ``public`` to the Cache-Control header of the
4018     response'.  All keys and values supported by the
4019     ``webob.cachecontrol.CacheControl`` interface may be added to the
4020     dictionary.  Supplying ``{'public':True}`` is equivalent to calling
4021     ``response.cache_control.public = True``.
4022
4023   Providing a non-tuple value as ``http_cache`` is equivalent to calling
4024   ``response.cache_expires(value)`` within your view's body.
4025
4026   Providing a two-tuple value as ``http_cache`` is equivalent to calling
4027   ``response.cache_expires(value[0], **value[1])`` within your view's body.
4028
4029   If you wish to avoid influencing, the ``Expires`` header, and instead wish
4030   to only influence ``Cache-Control`` headers, pass a tuple as ``http_cache``
4031   with the first element of ``None``, e.g.: ``(None, {'public':True})``.
4032
4033 Bug Fixes
4034 ---------
4035
4036 - Framework wrappers of the original view (such as http_cached and so on)
4037   relied on being able to trust that the response they were receiving was an
4038   IResponse.  It wasn't always, because the response was resolved by the
4039   router instead of early in the view wrapping process.  This has been fixed.
4040
4041 Documentation
4042 -------------
4043
4044 - Added a section in the "Webob" chapter named "Dealing With A JSON-Encoded
4045   Request Body" (usage of ``request.json_body``).
4046
4047 Behavior Changes
4048 ----------------
4049
4050 - The ``paster pshell``, ``paster proutes``, and ``paster pviews`` commands
4051   now take a single argument in the form ``/path/to/config.ini#sectionname``
4052   rather than the previous 2-argument spelling ``/path/to/config.ini
4053   sectionname``.  ``#sectionname`` may be omitted, in which case ``#main`` is
4054   assumed.
4055
4056 1.1a4 (2011-07-01)
4057 ==================
4058
4059 Bug Fixes
4060 ---------
4061
4062 - ``pyramid.testing.DummyRequest`` now raises deprecation warnings when
4063   attributes deprecated for ``pyramid.request.Request`` are accessed (like
4064   ``response_content_type``).  This is for the benefit of folks running unit
4065   tests which use DummyRequest instead of a "real" request, so they know
4066   things are deprecated without necessarily needing a functional test suite.
4067
4068 - The ``pyramid.events.subscriber`` directive behaved contrary to the
4069   documentation when passed more than one interface object to its
4070   constructor.  For example, when the following listener was registered::
4071
4072      @subscriber(IFoo, IBar)
4073      def expects_ifoo_events_and_ibar_events(event):
4074          print event
4075
4076   The Events chapter docs claimed that the listener would be registered and
4077   listening for both ``IFoo`` and ``IBar`` events.  Instead, it registered an
4078   "object event" subscriber which would only be called if an IObjectEvent was
4079   emitted where the object interface was ``IFoo`` and the event interface was
4080   ``IBar``.
4081
4082   The behavior now matches the documentation. If you were relying on the
4083   buggy behavior of the 1.0 ``subscriber`` directive in order to register an
4084   object event subscriber, you must now pass a sequence to indicate you'd
4085   like to register a subscriber for an object event. e.g.::
4086
4087      @subscriber([IFoo, IBar])
4088      def expects_object_event(object, event):
4089          print object, event
4090
4091 Features
4092 --------
4093
4094 - Add JSONP renderer (see "JSONP renderer" in the Renderers chapter of the
4095   documentation).
4096
4097 Deprecations
4098 ------------
4099
4100 - Deprecated the ``set_renderer_globals_factory`` method of the Configurator
4101   and the ``renderer_globals`` Configurator constructor parameter.
4102
4103 Documentation
4104 -------------
4105
4106 - The Wiki and Wiki2 tutorial "Tests" chapters each had two bugs: neither did
4107   told the user to depend on WebTest, and 2 tests failed in each as the
4108   result of changes to Pyramid itself.  These issues have been fixed.
4109
4110 - Move 1.0.X CHANGES.txt entries to HISTORY.txt.
4111
4112 1.1a3 (2011-06-26)
4113 ==================
4114
4115 Features
4116 --------
4117
4118 - Added ``mako.preprocessor`` config file parameter; allows for a Mako
4119   preprocessor to be specified as a Python callable or Python dotted name.
4120   See https://github.com/Pylons/pyramid/pull/183 for rationale.
4121
4122 Bug fixes
4123 ---------
4124
4125 - Pyramid would raise an AttributeError in the Configurator when attempting
4126   to set a ``__text__`` attribute on a custom predicate that was actually a
4127   classmethod.  See https://github.com/Pylons/pyramid/pull/217 .
4128
4129 - Accessing or setting deprecated response_* attrs on request
4130   (e.g. ``response_content_type``) now issues a deprecation warning at access
4131   time rather than at rendering time.
4132
4133 1.1a2 (2011-06-22)
4134 ==================
4135
4136 Bug Fixes
4137 ---------
4138
4139 - 1.1a1 broke Akhet by not providing a backwards compatibility import shim
4140   for ``pyramid.paster.PyramidTemplate``.  Now one has been added, although a
4141   deprecation warning is emitted when Akhet imports it.
4142
4143 - If multiple specs were provided in a single call to
4144   ``config.add_translation_dirs``, the directories were inserted into the
4145   beginning of the directory list in the wrong order: they were inserted in
4146   the reverse of the order they were provided in the ``*specs`` list (items
4147   later in the list were added before ones earlier in the list).  This is now
4148   fixed.
4149
4150 Backwards Incompatibilities
4151 ---------------------------
4152
4153 - The pyramid Router attempted to set a value into the key
4154   ``environ['repoze.bfg.message']`` when it caught a view-related exception
4155   for backwards compatibility with applications written for ``repoze.bfg``
4156   during error handling.  It did this by using code that looked like so::
4157
4158                     # "why" is an exception object
4159                     try: 
4160                         msg = why[0]
4161                     except:
4162                         msg = ''
4163
4164                     environ['repoze.bfg.message'] = msg
4165
4166   Use of the value ``environ['repoze.bfg.message']`` was docs-deprecated in
4167   Pyramid 1.0.  Our standing policy is to not remove features after a
4168   deprecation for two full major releases, so this code was originally slated
4169   to be removed in Pyramid 1.2.  However, computing the
4170   ``repoze.bfg.message`` value was the source of at least one bug found in
4171   the wild (https://github.com/Pylons/pyramid/issues/199), and there isn't a
4172   foolproof way to both preserve backwards compatibility and to fix the bug.
4173   Therefore, the code which sets the value has been removed in this release.
4174   Code in exception views which relies on this value's presence in the
4175   environment should now use the ``exception`` attribute of the request
4176   (e.g. ``request.exception[0]``) to retrieve the message instead of relying
4177   on ``request.environ['repoze.bfg.message']``.
4178
4179 1.1a1 (2011-06-20)
4180 ==================
4181
4182 Documentation
4183 -------------
4184
4185 - The term "template" used to refer to both "paster templates" and "rendered
4186   templates" (templates created by a rendering engine.  i.e. Mako, Chameleon,
4187   Jinja, etc.).  "Paster templates" will now be refered to as "scaffolds",
4188   whereas the name for "rendered templates" will remain as "templates."
4189
4190 - The ``wiki`` (ZODB+Traversal) tutorial was updated slightly.
4191
4192 - The ``wiki2`` (SQLA+URL Dispatch) tutorial was updated slightly.
4193
4194 - Make ``pyramid.interfaces.IAuthenticationPolicy`` and
4195   ``pyramid.interfaces.IAuthorizationPolicy`` public interfaces, and refer to
4196   them within the ``pyramid.authentication`` and ``pyramid.authorization``
4197   API docs.
4198
4199 - Render the function definitions for each exposed interface in
4200   ``pyramid.interfaces``.
4201
4202 - Add missing docs reference to
4203   ``pyramid.config.Configurator.set_view_mapper`` and refer to it within
4204   Hooks chapter section named "Using a View Mapper".
4205
4206 - Added section to the "Environment Variables and ``.ini`` File Settings"
4207   chapter in the narrative documentation section entitled "Adding a Custom
4208   Setting".
4209
4210 - Added documentation for a "multidict" (e.g. the API of ``request.POST``) as
4211   interface API documentation.
4212
4213 - Added a section to the "URL Dispatch" narrative chapter regarding the new
4214   "static" route feature.
4215
4216 - Added "What's New in Pyramid 1.1" to HTML rendering of documentation.
4217
4218 - Added API docs for ``pyramid.authentication.SessionAuthenticationPolicy``.
4219
4220 - Added API docs for ``pyramid.httpexceptions.exception_response``.
4221
4222 - Added "HTTP Exceptions" section to Views narrative chapter including a
4223   description of ``pyramid.httpexceptions.exception_response``.
4224
4225 Features
4226 --------
4227
4228 - Add support for language fallbacks: when trying to translate for a
4229   specific territory (such as ``en_GB``) fall back to translations
4230   for the language (ie ``en``). This brings the translation behaviour in line
4231   with GNU gettext and fixes partially translated texts when using C
4232   extensions.
4233
4234 - New authentication policy:
4235   ``pyramid.authentication.SessionAuthenticationPolicy``, which uses a session
4236   to store credentials.
4237
4238 - Accessing the ``response`` attribute of a ``pyramid.request.Request``
4239   object (e.g. ``request.response`` within a view) now produces a new
4240   ``pyramid.response.Response`` object.  This feature is meant to be used
4241   mainly when a view configured with a renderer needs to set response
4242   attributes: all renderers will use the Response object implied by
4243   ``request.response`` as the response object returned to the router.
4244
4245   ``request.response`` can also be used by code in a view that does not use a
4246   renderer, however the response object that is produced by
4247   ``request.response`` must be returned when a renderer is not in play (it is
4248   not a "global" response).
4249
4250 - Integers and longs passed as ``elements`` to ``pyramid.url.resource_url``
4251   or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context,
4252   request, 1, 2)`` (``1`` and ``2`` are the ``elements``) will now be
4253   converted implicitly to strings in the result.  Previously passing integers
4254   or longs as elements would cause a TypeError.
4255
4256 - ``pyramid_alchemy`` paster template now uses ``query.get`` rather than
4257   ``query.filter_by`` to take better advantage of identity map caching.
4258
4259 - ``pyramid_alchemy`` paster template now has unit tests.
4260
4261 - Added ``pyramid.i18n.make_localizer`` API (broken out from
4262   ``get_localizer`` guts).
4263
4264 - An exception raised by a NewRequest event subscriber can now be caught by
4265   an exception view.
4266
4267 - It is now possible to get information about why Pyramid raised a Forbidden
4268   exception from within an exception view.  The ``ACLDenied`` object returned
4269   by the ``permits`` method of each stock authorization policy
4270   (``pyramid.interfaces.IAuthorizationPolicy.permits``) is now attached to
4271   the Forbidden exception as its ``result`` attribute.  Therefore, if you've
4272   created a Forbidden exception view, you can see the ACE, ACL, permission,
4273   and principals involved in the request as
4274   eg. ``context.result.permission``, ``context.result.acl``, etc within the
4275   logic of the Forbidden exception view.
4276
4277 - Don't explicitly prevent the ``timeout`` from being lower than the
4278   ``reissue_time`` when setting up an ``AuthTktAuthenticationPolicy``
4279   (previously such a configuration would raise a ``ValueError``, now it's
4280   allowed, although typically nonsensical).  Allowing the nonsensical
4281   configuration made the code more understandable and required fewer tests.
4282
4283 - A new paster command named ``paster pviews`` was added.  This command
4284   prints a summary of potentially matching views for a given path.  See the
4285   section entitled "Displaying Matching Views for a Given URL" in the "View
4286   Configuration" chapter of the narrative documentation for more information.
4287
4288 - The ``add_route`` method of the Configurator now accepts a ``static``
4289   argument.  If this argument is ``True``, the added route will never be
4290   considered for matching when a request is handled.  Instead, it will only
4291   be useful for URL generation via ``route_url`` and ``route_path``.  See the
4292   section entitled "Static Routes" in the URL Dispatch narrative chapter for
4293   more information.
4294
4295 - A default exception view for the context
4296   ``pyramid.interfaces.IExceptionResponse`` is now registered by default.
4297   This means that an instance of any exception response class imported from
4298   ``pyramid.httpexceptions`` (such as ``HTTPFound``) can now be raised from
4299   within view code; when raised, this exception view will render the
4300   exception to a response.
4301
4302 - A function named ``pyramid.httpexceptions.exception_response`` is a
4303   shortcut that can be used to create HTTP exception response objects using
4304   an HTTP integer status code.
4305
4306 - The Configurator now accepts an additional keyword argument named
4307   ``exceptionresponse_view``.  By default, this argument is populated with a
4308   default exception view function that will be used when a response is raised
4309   as an exception. When ``None`` is passed for this value, an exception view
4310   for responses will not be registered.  Passing ``None`` returns the
4311   behavior of raising an HTTP exception to that of Pyramid 1.0 (the exception
4312   will propagate to middleware and to the WSGI server).
4313
4314 - The ``pyramid.request.Request`` class now has a ``ResponseClass`` interface
4315   which points at ``pyramid.response.Response``.
4316
4317 - The ``pyramid.response.Response`` class now has a ``RequestClass``
4318   interface which points at ``pyramid.request.Request``.
4319
4320 - It is now possible to return an arbitrary object from a Pyramid view
4321   callable even if a renderer is not used, as long as a suitable adapter to
4322   ``pyramid.interfaces.IResponse`` is registered for the type of the returned
4323   object by using the new
4324   ``pyramid.config.Configurator.add_response_adapter`` API.  See the section
4325   in the Hooks chapter of the documentation entitled "Changing How Pyramid
4326   Treats View Responses".
4327
4328 - The Pyramid router will now, by default, call the ``__call__`` method of
4329   WebOb response objects when returning a WSGI response.  This means that,
4330   among other things, the ``conditional_response`` feature of WebOb response
4331   objects will now behave properly.
4332
4333 - New method named ``pyramid.request.Request.is_response``.  This method
4334   should be used instead of the ``pyramid.view.is_response`` function, which
4335   has been deprecated.
4336
4337 Bug Fixes
4338 ---------
4339
4340 - URL pattern markers used in URL dispatch are permitted to specify a custom
4341   regex. For example, the pattern ``/{foo:\d+}`` means to match ``/12345``
4342   (foo==12345 in the match dictionary) but not ``/abc``. However, custom
4343   regexes in a pattern marker which used squiggly brackets did not work. For
4344   example, ``/{foo:\d{4}}`` would fail to match ``/1234`` and
4345   ``/{foo:\d{1,2}}`` would fail to match ``/1`` or ``/11``. One level of
4346   inner squiggly brackets is now recognized so that the prior two patterns
4347   given as examples now work. See also
4348   https://github.com/Pylons/pyramid/issues/#issue/123.
4349
4350 - Don't send port numbers along with domain information in cookies set by
4351   AuthTktCookieHelper (see https://github.com/Pylons/pyramid/issues/131).
4352
4353 - ``pyramid.url.route_path`` (and the shortcut
4354   ``pyramid.request.Request.route_url`` method) now include the WSGI
4355   SCRIPT_NAME at the front of the path if it is not empty (see
4356   https://github.com/Pylons/pyramid/issues/135).
4357
4358 - ``pyramid.testing.DummyRequest`` now has a ``script_name`` attribute (the
4359   empty string).
4360
4361 - Don't quote ``:@&+$,`` symbols in ``*elements`` passed to
4362   ``pyramid.url.route_url`` or ``pyramid.url.resource_url`` (see
4363   https://github.com/Pylons/pyramid/issues#issue/141).
4364
4365 - Include SCRIPT_NAME in redirects issued by
4366   ``pyramid.view.append_slash_notfound_view`` (see
4367   https://github.com/Pylons/pyramid/issues#issue/149).
4368
4369 - Static views registered with ``config.add_static_view`` which also included
4370   a ``permission`` keyword argument would not work as expected, because
4371   ``add_static_view`` also registered a route factory internally.  Because a
4372   route factory was registered internally, the context checked by the Pyramid
4373   permission machinery never had an ACL.  ``add_static_view`` no longer
4374   registers a route with a factory, so the default root factory will be used.
4375
4376 - ``config.add_static_view`` now passes extra keyword arguments it receives
4377   to ``config.add_route`` (calling add_static_view is mostly logically
4378   equivalent to adding a view of the type ``pyramid.static.static_view``
4379   hooked up to a route with a subpath).  This makes it possible to pass e.g.,
4380   ``factory=`` to ``add_static_view`` to protect a particular static view
4381   with a custom ACL.
4382
4383 - ``testing.DummyRequest`` used the wrong registry (the global registry) as
4384   ``self.registry`` if a dummy request was created *before* ``testing.setUp``
4385   was executed (``testing.setUp`` pushes a local registry onto the
4386   threadlocal stack). Fixed by implementing ``registry`` as a property for
4387   DummyRequest instead of eagerly assigning an attribute.
4388   See also https://github.com/Pylons/pyramid/issues/165
4389
4390 - When visiting a URL that represented a static view which resolved to a
4391   subdirectory, the ``index.html`` of that subdirectory would not be served
4392   properly.  Instead, a redirect to ``/subdir`` would be issued.  This has
4393   been fixed, and now visiting a subdirectory that contains an ``index.html``
4394   within a static view returns the index.html properly.  See also
4395   https://github.com/Pylons/pyramid/issues/67.
4396
4397 - Redirects issued by a static view did not take into account any existing
4398   ``SCRIPT_NAME`` (such as one set by a url mapping composite).  Now they do.
4399
4400 - The ``pyramid.wsgi.wsgiapp2`` decorator did not take into account the
4401   ``SCRIPT_NAME`` in the origin request.
4402
4403 - The ``pyramid.wsgi.wsgiapp2`` decorator effectively only worked when it
4404   decorated a view found via traversal; it ignored the ``PATH_INFO`` that was
4405   part of a url-dispatch-matched view.
4406
4407 Deprecations
4408 ------------
4409
4410 - Deprecated all assignments to ``request.response_*`` attributes (for
4411   example ``request.response_content_type = 'foo'`` is now deprecated).
4412   Assignments and mutations of assignable request attributes that were
4413   considered by the framework for response influence are now deprecated:
4414   ``response_content_type``, ``response_headerlist``, ``response_status``,
4415   ``response_charset``, and ``response_cache_for``.  Instead of assigning
4416   these to the request object for later detection by the rendering machinery,
4417   users should use the appropriate API of the Response object created by
4418   accessing ``request.response`` (e.g. code which does
4419   ``request.response_content_type = 'abc'`` should be changed to
4420   ``request.response.content_type = 'abc'``).
4421
4422 - Passing view-related parameters to
4423   ``pyramid.config.Configurator.add_route`` is now deprecated.  Previously, a
4424   view was permitted to be connected to a route using a set of ``view*``
4425   parameters passed to the ``add_route`` method of the Configurator.  This
4426   was a shorthand which replaced the need to perform a subsequent call to
4427   ``add_view``. For example, it was valid (and often recommended) to do::
4428
4429      config.add_route('home', '/', view='mypackage.views.myview',
4430                        view_renderer='some/renderer.pt')
4431
4432   Passing ``view*`` arguments to ``add_route`` is now deprecated in favor of
4433   connecting a view to a predefined route via ``Configurator.add_view`` using
4434   the route's ``route_name`` parameter.  As a result, the above example
4435   should now be spelled::
4436
4437      config.add_route('home', '/')
4438      config.add_view('mypackage.views.myview', route_name='home')
4439                      renderer='some/renderer.pt')
4440
4441   This deprecation was done to reduce confusion observed in IRC, as well as
4442   to (eventually) reduce documentation burden (see also
4443   https://github.com/Pylons/pyramid/issues/164).  A deprecation warning is
4444   now issued when any view-related parameter is passed to
4445   ``Configurator.add_route``.
4446
4447 - Passing an ``environ`` dictionary to the ``__call__`` method of a
4448   "traverser" (e.g. an object that implements
4449   ``pyramid.interfaces.ITraverser`` such as an instance of
4450   ``pyramid.traversal.ResourceTreeTraverser``) as its ``request`` argument
4451   now causes a deprecation warning to be emitted.  Consumer code should pass a
4452   ``request`` object instead.  The fact that passing an environ dict is
4453   permitted has been documentation-deprecated since ``repoze.bfg`` 1.1, and
4454   this capability will be removed entirely in a future version.
4455
4456 - The following (undocumented, dictionary-like) methods of the
4457   ``pyramid.request.Request`` object have been deprecated: ``__contains__``,
4458   ``__delitem__``, ``__getitem__``, ``__iter__``, ``__setitem__``, ``get``,
4459   ``has_key``, ``items``, ``iteritems``, ``itervalues``, ``keys``, ``pop``,
4460   ``popitem``, ``setdefault``, ``update``, and ``values``.  Usage of any of
4461   these methods will cause a deprecation warning to be emitted.  These
4462   methods were added for internal compatibility in ``repoze.bfg`` 1.1 (code
4463   that currently expects a request object expected an environ object in BFG
4464   1.0 and before).  In a future version, these methods will be removed
4465   entirely.
4466
4467 - Deprecated ``pyramid.view.is_response`` function in favor of (newly-added)
4468   ``pyramid.request.Request.is_response`` method.  Determining if an object
4469   is truly a valid response object now requires access to the registry, which
4470   is only easily available as a request attribute.  The
4471   ``pyramid.view.is_response`` function will still work until it is removed,
4472   but now may return an incorrect answer under some (very uncommon)
4473   circumstances.
4474
4475 Behavior Changes
4476 ----------------
4477
4478 - The default Mako renderer is now configured to escape all HTML in
4479   expression tags. This is intended to help prevent XSS attacks caused by
4480   rendering unsanitized input from users. To revert this behavior in user's
4481   templates, they need to filter the expression through the 'n' filter.
4482   For example, ${ myhtml | n }.
4483   See https://github.com/Pylons/pyramid/issues/193.
4484
4485 - A custom request factory is now required to return a request object that
4486   has a ``response`` attribute (or "reified"/lazy property) if they the
4487   request is meant to be used in a view that uses a renderer.  This
4488   ``response`` attribute should be an instance of the class
4489   ``pyramid.response.Response``.
4490
4491 - The JSON and string renderer factories now assign to
4492   ``request.response.content_type`` rather than
4493   ``request.response_content_type``.
4494
4495 - Each built-in renderer factory now determines whether it should change the
4496   content type of the response by comparing the response's content type
4497   against the response's default content type; if the content type is the
4498   default content type (usually ``text/html``), the renderer changes the
4499   content type (to ``application/json`` or ``text/plain`` for JSON and string
4500   renderers respectively).
4501
4502 - The ``pyramid.wsgi.wsgiapp2`` now uses a slightly different method of
4503   figuring out how to "fix" ``SCRIPT_NAME`` and ``PATH_INFO`` for the
4504   downstream application.  As a result, those values may differ slightly from
4505   the perspective of the downstream application (for example, ``SCRIPT_NAME``
4506   will now never possess a trailing slash).
4507
4508 - Previously, ``pyramid.request.Request`` inherited from
4509   ``webob.request.Request`` and implemented ``__getattr__``, ``__setattr__``
4510   and ``__delattr__`` itself in order to overidde "adhoc attr" WebOb behavior
4511   where attributes of the request are stored in the environ.  Now,
4512   ``pyramid.request.Request`` object inherits from (the more recent)
4513   ``webob.request.BaseRequest`` instead of ``webob.request.Request``, which
4514   provides the same behavior.  ``pyramid.request.Request`` no longer
4515   implements its own ``__getattr__``, ``__setattr__`` or ``__delattr__`` as a
4516   result.
4517
4518 - ``pyramid.response.Response`` is now a *subclass* of
4519   ``webob.response.Response`` (in order to directly implement the
4520   ``pyramid.interfaces.IResponse`` interface).
4521
4522 - The "exception response" objects importable from ``pyramid.httpexceptions``
4523   (e.g. ``HTTPNotFound``) are no longer just import aliases for classes that
4524   actually live in ``webob.exc``.  Instead, we've defined our own exception
4525   classes within the module that mirror and emulate the ``webob.exc``
4526   exception response objects almost entirely.  See the "Design Defense" doc
4527   section named "Pyramid Uses its Own HTTP Exception Classes" for more
4528   information.
4529
4530 Backwards Incompatibilities
4531 ---------------------------
4532
4533 - Pyramid no longer supports Python 2.4.  Python 2.5 or better is required to
4534   run Pyramid 1.1+.
4535
4536 - The Pyramid router now, by default, expects response objects returned from
4537   view callables to implement the ``pyramid.interfaces.IResponse`` interface.
4538   Unlike the Pyramid 1.0 version of this interface, objects which implement
4539   IResponse now must define a ``__call__`` method that accepts ``environ``
4540   and ``start_response``, and which returns an ``app_iter`` iterable, among
4541   other things.  Previously, it was possible to return any object which had
4542   the three WebOb ``app_iter``, ``headerlist``, and ``status`` attributes as
4543   a response, so this is a backwards incompatibility.  It is possible to get
4544   backwards compatibility back by registering an adapter to IResponse from
4545   the type of object you're now returning from view callables.  See the
4546   section in the Hooks chapter of the documentation entitled "Changing How
4547   Pyramid Treats View Responses".
4548
4549 - The ``pyramid.interfaces.IResponse`` interface is now much more extensive.
4550   Previously it defined only ``app_iter``, ``status`` and ``headerlist``; now
4551   it is basically intended to directly mirror the ``webob.Response`` API,
4552   which has many methods and attributes.
4553
4554 - The ``pyramid.httpexceptions`` classes named ``HTTPFound``,
4555   ``HTTPMultipleChoices``, ``HTTPMovedPermanently``, ``HTTPSeeOther``,
4556   ``HTTPUseProxy``, and ``HTTPTemporaryRedirect`` now accept ``location`` as
4557   their first positional argument rather than ``detail``.  This means that
4558   you can do, e.g. ``return pyramid.httpexceptions.HTTPFound('http://foo')``
4559   rather than ``return
4560   pyramid.httpexceptions.HTTPFound(location='http//foo')`` (the latter will
4561   of course continue to work).
4562
4563 Dependencies
4564 ------------
4565
4566 - Pyramid now depends on WebOb >= 1.0.2 as tests depend on the bugfix in that
4567   release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``".
4568   (Note that in reality, everyone should probably be using 1.0.4 or better
4569   though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.)
4570
e21ed8 4571 1.0 (2011-01-30)
CM 4572 ================
4573
4574 Documentation
4575 -------------
4576
4577 - Fixed bug in ZODB Wiki tutorial (missing dependency on ``docutils`` in
4578   "models" step within ``setup.py``).
4579
4580 - Removed API documentation for ``pyramid.testing`` APIs named
4581   ``registerDummySecurityPolicy``, ``registerResources``, ``registerModels``,
4582   ``registerEventListener``, ``registerTemplateRenderer``,
4583   ``registerDummyRenderer``, ``registerView``, ``registerUtility``,
4584   ``registerAdapter``, ``registerSubscriber``, ``registerRoute``,
4585   and ``registerSettings``.
4586
4587 - Moved "Using ZODB With ZEO" and "Using repoze.catalog Within Pyramid"
4588   tutorials out of core documentation and into the Pyramid Tutorials site
cd8ac8 4589   (http://docs.pylonsproject.org/projects/pyramid_tutorials/en/latest/).
e21ed8 4590
CM 4591 - Changed "Cleaning up After a Request" section in the URL Dispatch chapter
4592   to use ``request.add_finished_callback`` instead of jamming an object with
4593   a ``__del__`` into the WSGI environment.
4594
4595 - Remove duplication of ``add_route`` API documentation from URL Dispatch
4596   narrative chapter.
4597
4598 - Remove duplication of API and narrative documentation in
4599   ``pyramid.view.view_config`` API docs by pointing to
4600   ``pyramid.config.add_view`` documentation and narrative chapter
4601   documentation.
4602
4603 - Removed some API documentation duplicated in narrative portions of
4604   documentation 
4605
4606 - Removed "Overall Flow of Authentication" from SQLAlchemy + URL Dispatch
4607   wiki tutorial due to print space concerns (moved to Pyramid Tutorials
4608   site).
4609
4610 Bug Fixes
4611 ---------
4612
4613 - Deprecated-since-BFG-1.2 APIs from ``pyramid.testing`` now properly emit
4614   deprecation warnings.
4615
4616 - Added ``egg:repoze.retry#retry`` middleware to the WSGI pipeline in ZODB
4617   templates (retry ZODB conflict errors which occur in normal operations).
4618
4619 - Removed duplicate implementations of ``is_response``.  Two competing
4620   implementations existed: one in ``pyramid.config`` and one in
4621   ``pyramid.view``.  Now the one defined in ``pyramid.view`` is used
4622   internally by ``pyramid.config`` and continues to be advertised as an API.
4623
4624 1.0b3 (2011-01-28)
4625 ==================
4626
4627 Bug Fixes
4628 ---------
4629
4630 - Use &copy; instead of copyright symbol in paster templates / tutorial
4631   templates for the benefit of folks who cutnpaste and save to a non-UTF8
4632   format.
4633
4634 - ``pyramid.view.append_slash_notfound_view`` now preserves GET query
4635   parameters across redirects.
4636
4637 Documentation
4638 -------------
4639
4640 - Beef up documentation related to ``set_default_permission``: explicitly
4641   mention that default permissions also protect exception views.
4642
4643 - Paster templates and tutorials now use spaces instead of tabs in their HTML
4644   templates.
4645
4646 1.0b2 (2011-01-24)
4647 ==================
4648
4649 Bug Fixes
4650 ---------
4651
4652 - The ``production.ini`` generated by all paster templates now have an
4653   effective logging level of WARN, which prevents e.g. SQLAlchemy statement
4654   logging and other inappropriate output.
4655
4656 - The ``production.ini`` of the ``pyramid_routesalchemy`` and
4657   ``pyramid_alchemy`` paster templates did not have a ``sqlalchemy`` logger
4658   section, preventing ``paster serve production.ini`` from working.
4659
4660 - The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` paster templates used
4661   the ``{{package}}`` variable in a place where it should have used the
4662   ``{{project}}`` variable, causing applications created with uppercase
4663   letters e.g. ``paster create -t pyramid_routesalchemy Dibbus`` to fail to
4664   start when ``paster serve development.ini`` was used against the result.
4665   See https://github.com/Pylons/pyramid/issues/#issue/107
4666
4667 - The ``render_view`` method of ``pyramid.renderers.RendererHelper`` passed
4668   an incorrect value into the renderer for ``renderer_info``.  It now passes
4669   an instance of ``RendererHelper`` instead of a dictionary, which is
4670   consistent with other usages.  See
4671   https://github.com/Pylons/pyramid/issues#issue/106
4672
4673 - A bug existed in the ``pyramid.authentication.AuthTktCookieHelper`` which
4674   would break any usage of an AuthTktAuthenticationPolicy when one was
4675   configured to reissue its tokens (``reissue_time`` < ``timeout`` /
4676   ``max_age``). Symptom: ``ValueError: ('Invalid token %r', '')``.  See
4677   https://github.com/Pylons/pyramid/issues#issue/108.
4678
4679 1.0b1 (2011-01-21)
4680 ==================
4681
4682 Features
4683 --------
4684
4685 - The AuthTktAuthenticationPolicy now accepts a ``tokens`` parameter via
4686   ``pyramid.security.remember``.  The value must be a sequence of strings.
4687   Tokens are placed into the auth_tkt "tokens" field and returned in the
4688   auth_tkt cookie.
4689
4690 - Add ``wild_domain`` argument to AuthTktAuthenticationPolicy, which defaults
4691   to ``True``.  If it is set to ``False``, the feature of the policy which
b4cd53 4692   sets a cookie with a wildcard domain will be turned off.
e21ed8 4693
CM 4694 - Add a ``MANIFEST.in`` file to each paster template. See
4695   https://github.com/Pylons/pyramid/issues#issue/95
4696
4697 Bug Fixes
4698 ---------
4699
4700 - ``testing.setUp`` now adds a ``settings`` attribute to the registry (both
4701   when it's passed a registry without any settings and when it creates one).
4702
4703 - The ``testing.setUp`` function now takes a ``settings`` argument, which
4704   should be a dictionary.  Its values will subsequently be available on the
4705   returned ``config`` object as ``config.registry.settings``.
4706
4707 Documentation
4708 -------------
4709
4710 - Added "What's New in Pyramid 1.0" chapter to HTML rendering of
4711   documentation.
4712
4713 - Merged caseman-master narrative editing branch, many wording fixes and
4714   extensions.
4715
4716 - Fix deprecated example showing ``chameleon_zpt`` API call in testing
4717   narrative chapter.
4718
4719 - Added "Adding Methods to the Configurator via ``add_directive``" section to
4720   Advanced Configuration narrative chapter.
4721
4722 - Add docs for ``add_finished_callback``, ``add_response_callback``,
4723   ``route_path``, ``route_url``, and ``static_url`` methods to
4724   ``pyramid.request.Request`` API docs.
4725
4726 - Add (minimal) documentation about using I18N within Mako templates to
4727   "Internationalization and Localization" narrative chapter.
4728
4729 - Move content of "Forms" chapter back to "Views" chapter; I can't think of a
4730   better place to put it.
4731
4732 - Slightly improved interface docs for ``IAuthorizationPolicy``.
4733
4734 - Minimally explain usage of custom regular expressions in URL dispatch
4735   replacement markers within URL Dispatch chapter.
4736
4737 Deprecations
4738 -------------
4739
4740 - Using the ``pyramid.view.bfg_view`` alias for ``pyramid.view.view_config``
4741   (a backwards compatibility shim) now issues a deprecation warning.
4742
4743 Backwards Incompatibilities
4744 ---------------------------
4745
4746 - Using ``testing.setUp`` now registers an ISettings utility as a side
4747   effect.  Some test code which queries for this utility after
4748   ``testing.setUp`` via queryAdapter will expect a return value of ``None``.
4749   This code will need to be changed.
4750
4751 - When a ``pyramid.exceptions.Forbidden`` error is raised, its status code
4752   now ``403 Forbidden``.  It was previously ``401 Unauthorized``, for
4753   backwards compatibility purposes with ``repoze.bfg``.  This change will
4754   cause problems for users of Pyramid with ``repoze.who``, which intercepts
4755   ``401 Unauthorized`` by default, but allows ``403 Forbidden`` to pass
4756   through.  Those deployments will need to configure ``repoze.who`` to also
4757   react to ``403 Forbidden``.
4758
4759 - The default value for the ``cookie_on_exception`` parameter to
4760   ``pyramid.session.UnencyrptedCookieSessionFactory`` is now ``True``.  This
4761   means that when view code causes an exception to be raised, and the session
4762   has been mutated, a cookie will be sent back in the response.  Previously
4763   its default value was ``False``.
4764
4765 Paster Templates
4766 ----------------
4767
4768 - The ``pyramid_zodb``, ``pyramid_routesalchemy`` and ``pyramid_alchemy``
4769   paster templates now use a default "commit veto" hook when configuring the
4770   ``repoze.tm2`` transaction manager in ``development.ini``.  This prevents a
4771   transaction from being committed when the response status code is within
4772   the 400 or 500 ranges.  See also
4773   http://docs.repoze.org/tm2/#using-a-commit-veto.
4774
4775 1.0a10 (2011-01-18)
4776 ===================
4777
4778 Bug Fixes
4779 ---------
4780
4781 - URL dispatch now properly handles a ``.*`` or ``*`` appearing in a regex
4782   match when used inside brackets.  Resolves issue #90.
4783
4784 Backwards Incompatibilities
4785 ---------------------------
4786
4787 - The ``add_handler`` method of a Configurator has been removed from the
4788   Pyramid core.  Handlers are now a feature of the ``pyramid_handlers``
4789   package, which can be downloaded from PyPI.  Documentation for the package
4790   should be available via
cd8ac8 4791   http://docs.pylonsproject.org/projects/pyramid_handlers/en/latest/,
TL 4792   which describes how
e21ed8 4793   to add a configuration statement to your ``main`` block to reobtain this
CM 4794   method.  You will also need to add an ``install_requires`` dependency upon
4795   ``pyramid_handlers`` to your ``setup.py`` file.
4796
4797 - The ``load_zcml`` method of a Configurator has been removed from the
4798   Pyramid core.  Loading ZCML is now a feature of the ``pyramid_zcml``
4799   package, which can be downloaded from PyPI.  Documentation for the package
4800   should be available via
cd8ac8 4801   http://docs.pylonsproject.org/projects/pyramid_zcml/en/latest/,
TL 4802   which describes how
e21ed8 4803   to add a configuration statement to your ``main`` block to reobtain this
CM 4804   method.  You will also need to add an ``install_requires`` dependency upon
4805   ``pyramid_zcml`` to your ``setup.py`` file.
4806
4807 - The ``pyramid.includes`` subpackage has been removed.  ZCML files which use
4808   include the package ``pyramid.includes`` (e.g. ``<include
4809   package="pyramid.includes"/>``) now must include the ``pyramid_zcml``
4810   package instead (e.g. ``<include package="pyramid_zcml"/>``).
4811
4812 - The ``pyramid.view.action`` decorator has been removed from the Pyramid
4813   core.  Handlers are now a feature of the ``pyramid_handlers`` package.  It
4814   should now be imported from ``pyramid_handlers`` e.g. ``from
4815   pyramid_handlers import action``.
4816
4817 - The ``handler`` ZCML directive has been removed.  It is now a feature of
4818   the ``pyramid_handlers`` package.
4819
4820 - The ``pylons_minimal``, ``pylons_basic`` and ``pylons_sqla`` paster
4821   templates were removed.  Use ``pyramid_sqla`` (available from PyPI) as a
4822   generic replacement for Pylons-esque development.
4823
4824 - The ``make_app`` function has been removed from the ``pyramid.router``
4825   module.  It continues life within the ``pyramid_zcml`` package.  This
4826   leaves the ``pyramid.router`` module without any API functions.
4827
4828 - The ``configure_zcml`` setting within the deployment settings (within
4829   ``**settings`` passed to a Pyramid ``main`` function) has ceased to have any
4830   meaning.
4831
4832 Features
4833 --------
4834
4835 - ``pyramid.testing.setUp`` and ``pyramid.testing.tearDown`` have been
4836   undeprecated.  They are now the canonical setup and teardown APIs for test
4837   configuration, replacing "direct" creation of a Configurator.  This is a
4838   change designed to provide a facade that will protect against any future
4839   Configurator deprecations.
4840
4841 - Add ``charset`` attribute to ``pyramid.testing.DummyRequest``
4842   (unconditionally ``UTF-8``).
4843
4844 - Add ``add_directive`` method to configurator, which allows framework
4845   extenders to add methods to the configurator (ala ZCML directives).
4846
4847 - When ``Configurator.include`` is passed a *module* as an argument, it
4848   defaults to attempting to find and use a callable named ``includeme``
4849   within that module.  This makes it possible to use
4850   ``config.include('some.module')`` rather than
4851   ``config.include('some.module.somefunc')`` as long as the include function
4852   within ``some.module`` is named ``includeme``.
4853
4854 - The ``bfg2pyramid`` script now converts ZCML include tags that have
4855   ``repoze.bfg.includes`` as a package attribute to the value
4856   ``pyramid_zcml``.  For example, ``<include package="repoze.bfg.includes">``
4857   will be converted to ``<include package="pyramid_zcml">``.
4858
4859 Paster Templates
4860 ----------------
4861
4862 - All paster templates now use ``pyramid.testing.setUp`` and
4863   ``pyramid.testing.tearDown`` rather than creating a Configurator "by hand"
4864   within their ``tests.py`` module, as per decision in features above.
4865
4866 - The ``starter_zcml`` paster template has been moved to the ``pyramid_zcml``
4867   package.
4868
4869 Documentation
4870 -------------
4871
4872 - The wiki and wiki2 tutorials now use ``pyramid.testing.setUp`` and
4873   ``pyramid.testing.tearDown`` rather than creating a Configurator "by hand",
4874   as per decision in features above.
4875
4876 - The "Testing" narrative chapter now explains ``pyramid.testing.setUp`` and
4877   ``pyramid.testing.tearDown`` instead of Configurator creation and
4878   ``Configurator.begin()`` and ``Configurator.end()``.
4879
4880 - Document the ``request.override_renderer`` attribute within the narrative
4881   "Renderers" chapter in a section named "Overriding A Renderer at Runtime".
4882
4883 - The "Declarative Configuration" narrative chapter has been removed (it was
4884   moved to the ``pyramid_zcml`` package).
4885
4886 - Most references to ZCML in narrative chapters have been removed or
4887   redirected to ``pyramid_zcml`` locations.
4888
4889 Deprecations
4890 ------------
4891
4892 - Deprecation warnings related to import of the following API functions were
4893   added: ``pyramid.traversal.find_model``, ``pyramid.traversal.model_path``,
4894   ``pyramid.traversal.model_path_tuple``, ``pyramid.url.model_url``.  The
4895   instructions emitted by the deprecation warnings instruct the developer to
4896   change these method spellings to their ``resource`` equivalents.  This is a
4897   consequence of the mass concept rename of "model" to "resource" performed
4898   in 1.0a7.
4899
4900 1.0a9 (2011-01-08)
4901 ==================
4902
4903 Bug Fixes
4904 ---------
4905
4906 - The ``proutes`` command tried too hard to resolve the view for printing,
4907   resulting in exceptions when an exceptional root factory was encountered.
4908   Instead of trying to resolve the view, if it cannot, it will now just print
4909   ``<unknown>``.
4910
4911 - The `self` argument was included in new methods of the ``ISession`` interface
4912   signature, causing ``pyramid_beaker`` tests to fail.
4913
4914 - Readd ``pyramid.traversal.model_path_tuple`` as an alias for
4915   ``pyramid.traversal.resource_path_tuple`` for backwards compatibility.
4916
4917 Features
4918 --------
4919
4920 - Add a new API ``pyramid.url.current_route_url``, which computes a URL based
4921   on the "current" route (if any) and its matchdict values.
4922
4923 - ``config.add_view`` now accepts a ``decorator`` keyword argument, a callable
4924   which will decorate the view callable before it is added to the registry.
4925
4926 - If a handler class provides an ``__action_decorator__`` attribute (usually
4927   a classmethod or staticmethod), use that as the decorator for each view
4928   registration for that handler.
4929
4930 - The ``pyramid.interfaces.IAuthenticationPolicy`` interface now specifies an
4931   ``unauthenticated_userid`` method.  This method supports an important
4932   optimization required by people who are using persistent storages which do
4933   not support object caching and whom want to create a "user object" as a
4934   request attribute.
4935
4936 - A new API has been added to the ``pyramid.security`` module named
4937   ``unauthenticated_userid``.  This API function calls the
4938   ``unauthenticated_userid`` method of the effective security policy.
4939
4940 - An ``unauthenticated_userid`` method has been added to the dummy
4941   authentication policy returned by
4942   ``pyramid.config.Configurator.testing_securitypolicy``.  It returns the
4943   same thing as that the dummy authentication policy's
4944   ``authenticated_userid`` method.
4945
4946 - The class ``pyramid.authentication.AuthTktCookieHelper`` is now an API.
4947   This class can be used by third-party authentication policy developers to
4948   help in the mechanics of authentication cookie-setting.
4949
4950 - New constructor argument to Configurator: ``default_view_mapper``.  Useful
4951   to create systems that have alternate view calling conventions.  A view
4952   mapper allows objects that are meant to be used as view callables to have
4953   an arbitrary argument list and an arbitrary result.  The object passed as
4954   ``default_view_mapper`` should implement the
4955   ``pyramid.interfaces.IViewMapperFactory`` interface.
4956
4957 - add a ``set_view_mapper`` API to Configurator.  Has
4958   the same result as passing ``default_view_mapper`` to the Configurator
4959   constructor.
4960
4961 - ``config.add_view`` now accepts a ``mapper`` keyword argument, which should
4962   either be ``None``, a string representing a Python dotted name, or an
4963   object which is an ``IViewMapperFactory``.  This feature is not useful for
4964   "civilians", only for extension writers.
4965
4966 - Allow static renderer provided during view registration to be overridden at
4967   request time via a request attribute named ``override_renderer``, which
4968   should be the name of a previously registered renderer.  Useful to provide
4969   "omnipresent" RPC using existing rendered views.
4970
4971 - Instances of ``pyramid.testing.DummyRequest`` now have a ``session``
4972   object, which is mostly a dictionary, but also implements the other session
4973   API methods for flash and CSRF.
4974
4975 Backwards Incompatibilities
4976 ---------------------------
4977
4978 - Since the ``pyramid.interfaces.IAuthenticationPolicy`` interface now
4979   specifies that a policy implementation must implement an
4980   ``unauthenticated_userid`` method, all third-party custom authentication
4981   policies now must implement this method.  It, however, will only be called
4982   when the global function named ``pyramid.security.unauthenticated_userid``
4983   is invoked, so if you're not invoking that, you will not notice any issues.
4984
4985 - ``pyramid.interfaces.ISession.get_csrf_token`` now mandates that an
4986   implementation should return a *new* token if one doesn't already exist in
4987   the session (previously it would return None).  The internal sessioning
4988   implementation has been changed.
4989
4990 Documentation
4991 -------------
4992
4993 - The (weak) "Converting a CMF Application to Pyramid" tutorial has been
4994   removed from the tutorials section.  It was moved to the
4995   ``pyramid_tutorials`` Github repository.
4996
4997 - The "Resource Location and View Lookup" chapter has been replaced with a
4998   variant of Rob Miller's "Much Ado About Traversal" (originally published at
4999   http://blog.nonsequitarian.org/2010/much-ado-about-traversal/).
5000
5001 - Many minor wording tweaks and refactorings (merged Casey Duncan's docs
5002   fork, in which he is working on general editing).
5003
5004 - Added (weak) description of new view mapper feature to Hooks narrative
5005   chapter.
5006
5007 - Split views chapter into 2: View Callables and View Configuration.
5008
5009 - Reorder Renderers and Templates chapters after View Callables but before
5010   View Configuration.
5011
5012 - Merge Session Objects, Cross-Site Request Forgery, and Flash Messaging
5013   chapter into a single Sessions chapter.
5014
5015 - The Wiki and Wiki2 tutorials now have much nicer CSS and graphics.
5016
5017 Internals
5018 ---------
5019
5020 - The "view derivation" code is now factored into a set of classes rather
5021   than a large number of standalone functions (a side effect of the
5022   view mapper refactoring).
5023
5024 - The ``pyramid.renderer.RendererHelper`` class has grown a ``render_view``
5025   method, which is used by the default view mapper (a side effect of the
5026   view mapper refactoring).
5027
5028 - The object passed as ``renderer`` to the "view deriver" is now an instance
5029   of ``pyramid.renderers.RendererHelper`` rather than a dictionary (a side
5030   effect of view mapper refactoring).
5031
5032 - The class used as the "page template" in ``pyramid.chameleon_text`` was
5033   removed, in preference to using a Chameleon-inbuilt version.
5034
5035 - A view callable wrapper registered in the registry now contains an
5036   ``__original_view__`` attribute which references the original view callable
5037   (or class).
5038
5039 - The (non-API) method of all internal authentication policy implementations
5040   previously named ``_get_userid`` is now named ``unauthenticated_userid``,
5041   promoted to an API method.  If you were overriding this method, you'll now
5042   need to override it as ``unauthenticated_userid`` instead.
5043
5044 - Remove (non-API) function of config.py named _map_view.
5045
5046 1.0a8 (2010-12-27)
5047 ==================
5048
5049 Bug Fixes
5050 ---------
5051
5052 - The name ``registry`` was not available in the ``paster pshell``
5053   environment under IPython.
5054
5055 Features
5056 --------
5057
5058 - If a resource implements a ``__resource_url__`` method, it will be called
5059   as the result of invoking the ``pyramid.url.resource_url`` function to
5060   generate a URL, overriding the default logic.  See the new "Generating The
5061   URL Of A Resource" section within the Resources narrative chapter.
5062
5063 - Added flash messaging, as described in the "Flash Messaging" narrative
5064   documentation chapter.
5065
5066 - Added CSRF token generation, as described in the narrative chapter entitled
5067   "Preventing Cross-Site Request Forgery Attacks".
5068
5069 - Prevent misunderstanding of how the ``view`` and ``view_permission``
5070   arguments to add_route work by raising an exception during configuration if
5071   view-related arguments exist but no ``view`` argument is passed.
5072
5073 - Add ``paster proute`` command which displays a summary of the routing
5074   table.  See the narrative documentation section within the "URL Dispatch"
5075   chapter entitled "Displaying All Application Routes".
5076
5077 Paster Templates
5078 ----------------
5079
5080 - The ``pyramid_zodb`` Paster template no longer employs ZCML.  Instead, it
5081   is based on scanning.
5082
5083 Documentation
5084 -------------
5085
5086 - Added "Generating The URL Of A Resource" section to the Resources narrative
5087   chapter (includes information about overriding URL generation using
5088   ``__resource_url__``).
5089
5090 - Added "Generating the Path To a Resource" section to the Resources
5091   narrative chapter.
5092
5093 - Added "Finding a Resource by Path" section to the Resources narrative
5094   chapter.
5095
5096 - Added "Obtaining the Lineage of a Resource" to the Resources narrative
5097   chapter.
5098
5099 - Added "Determining if a Resource is In The Lineage of Another Resource" to
5100   Resources narrative chapter.
5101
5102 - Added "Finding the Root Resource" to Resources narrative chapter.
5103
5104 - Added "Finding a Resource With a Class or Interface in Lineage" to
5105   Resources narrative chapter.
5106
5107 - Added a "Flash Messaging" narrative documentation chapter.
5108
5109 - Added a narrative chapter entitled "Preventing Cross-Site Request Forgery
5110   Attacks".
5111
5112 - Changed the "ZODB + Traversal Wiki Tutorial" based on changes to
5113   ``pyramid_zodb`` Paster template.
5114
5115 - Added "Advanced Configuration" narrative chapter which documents how to
5116   deal with configuration conflicts, two-phase configuration, ``include`` and
5117   ``commit``.
5118
5119 - Fix API documentation rendering for ``pyramid.view.static``
5120
5121 - Add "Pyramid Provides More Than One Way to Do It" to Design Defense
5122   documentation.
5123
5124 - Changed "Static Assets" narrative chapter: clarify that ``name`` represents
5125   a prefix unless it's a URL, added an example of a root-relative static view
5126   fallback for URL dispatch, added an example of creating a simple view that
5127   returns the body of a file.
5128
5129 - Move ZCML usage in Hooks chapter to Declarative Configuration chapter.
5130
5131 - Merge "Static Assets" chapter into the "Assets" chapter.
5132
5133 - Added narrative documentation section within the "URL Dispatch" chapter
5134   entitled "Displaying All Application Routes" (for ``paster proutes``
5135   command).
5136
5137 1.0a7 (2010-12-20)
5138 ==================
5139
5140 Terminology Changes
5141 -------------------
5142
5143 - The Pyramid concept previously known as "model" is now known as "resource".
5144   As a result:
5145
5146   - The following API changes have been made::
5147
5148       pyramid.url.model_url -> 
5149                         pyramid.url.resource_url
5150
5151       pyramid.traversal.find_model -> 
5152                         pyramid.url.find_resource
5153
5154       pyramid.traversal.model_path ->
5155                         pyramid.traversal.resource_path
5156
5157       pyramid.traversal.model_path_tuple ->
5158                         pyramid.traversal.resource_path_tuple
5159
5160       pyramid.traversal.ModelGraphTraverser -> 
5161                         pyramid.traversal.ResourceTreeTraverser
5162
5163       pyramid.config.Configurator.testing_models ->
5164                         pyramid.config.Configurator.testing_resources
5165
5166       pyramid.testing.registerModels ->
5167                         pyramid.testing.registerResources
5168
5169       pyramid.testing.DummyModel ->
5170                         pyramid.testing.DummyResource
5171
5172    - All documentation which previously referred to "model" now refers to
5173      "resource".
5174
5175    - The ``starter`` and ``starter_zcml`` paster templates now have a
5176      ``resources.py`` module instead of a ``models.py`` module.
5177
5178   - Positional argument names of various APIs have been changed from
5179     ``model`` to ``resource``.
5180
5181   Backwards compatibility shims have been left in place in all cases.  They
5182   will continue to work "forever".
5183
5184 - The Pyramid concept previously known as "resource" is now known as "asset".
5185   As a result:
5186
5187   - The (non-API) module previously known as ``pyramid.resource`` is now
5188     known as ``pyramid.asset``.
5189
5190   - All docs that previously referred to "resource specification" now refer
5191     to "asset specification".
5192
5193   - The following API changes were made::
5194
5195       pyramid.config.Configurator.absolute_resource_spec ->
5196                         pyramid.config.Configurator.absolute_asset_spec
5197
5198       pyramid.config.Configurator.override_resource ->
5199                         pyramid.config.Configurator.override_asset
5200
5201   - The ZCML directive previously known as ``resource`` is now known as
5202     ``asset``.
5203
5204   - The setting previously known as ``BFG_RELOAD_RESOURCES`` (envvar) or
5205     ``reload_resources`` (config file) is now known, respectively, as
5206     ``PYRAMID_RELOAD_ASSETS`` and ``reload_assets``.
5207
5208   Backwards compatibility shims have been left in place in all cases.  They
5209   will continue to work "forever".
5210
5211 Bug Fixes
5212 ---------
5213
5214 - Make it possible to succesfully run all tests via ``nosetests`` command
5215   directly (rather than indirectly via ``python setup.py nosetests``).
5216
5217 - When a configuration conflict is encountered during scanning, the conflict
5218   exception now shows the decorator information that caused the conflict.
5219
5220 Features
5221 --------
5222
5223 - Added ``debug_routematch`` configuration setting that logs matched routes
5224   (including the matchdict and predicates).
5225
5226 - The name ``registry`` is now available in a ``pshell`` environment by
5227   default.  It is the application registry object.
5228
5229 Environment
5230 -----------
5231
5232 - All environment variables which used to be prefixed with ``BFG_`` are now
5233   prefixed with ``PYRAMID_`` (e.g. ``BFG_DEBUG_NOTFOUND`` is now
5234   ``PYRAMID_DEBUG_NOTFOUND``)
5235
5236 Documentation
5237 -------------
5238
5239 - Added "Debugging Route Matching" section to the urldispatch narrative
5240   documentation chapter.
5241
5242 - Added reference to ``PYRAMID_DEBUG_ROUTEMATCH`` envvar and ``debug_routematch``
5243   config file setting to the Environment narrative docs chapter.
5244
5245 - Changed "Project" chapter slightly to expand on use of ``paster pshell``.
5246
5247 - Direct Jython users to Mako rather than Jinja2 in "Install" narrative
5248   chapter.
5249
5250 - Many changes to support terminological renaming of "model" to "resource"
5251   and "resource" to "asset".
5252
5253 - Added an example of ``WebTest`` functional testing to the testing narrative
5254   chapter.
5255
5256 - Rearranged chapter ordering by popular demand (URL dispatch first, then
5257   traversal).  Put hybrid chapter after views chapter.
5258
5259 - Split off "Renderers" as its own chapter from "Views" chapter in narrative
5260   documentation.
5261
5262 Paster Templates
5263 ----------------
5264
5265 - Added ``debug_routematch = false`` to all paster templates.
5266
5267 Dependencies
5268 ------------
5269
5270 - Depend on Venusian >= 0.5 (for scanning conflict exception decoration).
5271
5272 1.0a6 (2010-12-15)
5273 ==================
5274
5275 Bug Fixes
5276 ---------
5277
5278 - 1.0a5 introduced a bug when ``pyramid.config.Configurator.scan`` was used
5279   without a ``package`` argument (e.g. ``config.scan()`` as opposed to
5280   ``config.scan('packagename')``.  The symptoms were: lots of deprecation
5281   warnings printed to the console about imports of deprecated Pyramid
5282   functions and classes and non-detection of view callables decorated with
5283   ``view_config`` decorators.  This has been fixed.
5284
5285 - Tests now pass on Windows (no bugs found, but a few tests in the test suite
5286   assumed UNIX path segments in filenames).
5287
5288 Documentation
5289 -------------
5290
5291 - If you followed it to-the-letter, the ZODB+Traversal Wiki tutorial would
5292   instruct you to run a test which would fail because the view callable
5293   generated by the ``pyramid_zodb`` tutorial used a one-arg view callable,
5294   but the test in the sample code used a two-arg call.
5295
5296 - Updated ZODB+Traversal tutorial setup.py of all steps to match what's
5297   generated by ``pyramid_zodb``.
5298
5299 - Fix reference to ``repoze.bfg.traversalwrapper`` in "Models" chapter (point
5300   at ``pyramid_traversalwrapper`` instead).
5301
5302 1.0a5 (2010-12-14)
5303 ==================
5304
5305 Features
5306 --------
5307
5308 - Add a ``handler`` ZCML directive.  This directive does the same thing as
5309   ``pyramid.configuration.add_handler``.
5310
5311 - A new module named ``pyramid.config`` was added.  It subsumes the duties of
5312   the older ``pyramid.configuration`` module.
5313
5314 - The new ``pyramid.config.Configurator` class has API methods that the older
5315   ``pyramid.configuration.Configurator`` class did not: ``with_context`` (a
5316   classmethod), ``include``, ``action``, and ``commit``.  These methods exist
5317   for imperative application extensibility purposes.
5318
5319 - The ``pyramid.testing.setUp`` function now accepts an ``autocommit``
5320   keyword argument, which defaults to ``True``.  If it is passed ``False``,
5321   the Config object returned by ``setUp`` will be a non-autocommiting Config
5322   object.
5323
5324 - Add logging configuration to all paster templates.
5325
5326 - ``pyramid_alchemy``, ``pyramid_routesalchemy``, and ``pylons_sqla`` paster
5327   templates now use idiomatic SQLAlchemy configuration in their respective
5328   ``.ini`` files and Python code.
5329
5330 - ``pyramid.testing.DummyRequest`` now has a class variable,
5331   ``query_string``, which defaults to the empty string.
5332
5333 - Add support for json on GAE by catching NotImplementedError and importing
5334   simplejson from django.utils.
5335
5336 - The Mako renderer now accepts a resource specification for
5337   ``mako.module_directory``.
5338
5339 - New boolean Mako settings variable ``mako.strict_undefined``.  See `Mako
5340   Context Variables
5341   <http://www.makotemplates.org/docs/runtime.html#context-variables>`_ for
5342   its meaning.
5343
5344 Dependencies
5345 ------------
5346
5347 - Depend on Mako 0.3.6+ (we now require the ``strict_undefined`` feature).
5348
5349 Bug Fixes
5350 ---------
5351
5352 - When creating a Configurator from within a ``paster pshell`` session, you
5353   were required to pass a ``package`` argument although ``package`` is not
5354   actually required.  If you didn't pass ``package``, you would receive an
5355   error something like ``KeyError: '__name__'`` emanating from the
5356   ``pyramid.path.caller_module`` function.  This has now been fixed.
5357
5358 - The ``pyramid_routesalchemy`` paster template's unit tests failed
5359   (``AssertionError: 'SomeProject' != 'someproject'``).  This is fixed.
5360
5361 - Make default renderer work (renderer factory registered with no name, which
5362   is active for every view unless the view names a specific renderer).
5363
5364 - The Mako renderer did not properly turn the ``mako.imports``,
5365   ``mako.default_filters``, and ``mako.imports`` settings into lists.
5366
5367 - The Mako renderer did not properly convert the ``mako.error_handler``
5368   setting from a dotted name to a callable.
5369
5370 Documentation
5371 -------------
5372
5373 - Merged many wording, readability, and correctness changes to narrative
5374   documentation chapters from https://github.com/caseman/pyramid (up to and
5375   including "Models" narrative chapter).
5376
5377 - "Sample Applications" section of docs changed to note existence of Cluegun,
5378   Shootout and Virginia sample applications, ported from their repoze.bfg
5379   origin packages.
5380
5381 - SQLAlchemy+URLDispatch tutorial updated to integrate changes to
5382   ``pyramid_routesalchemy`` template.
5383
5384 - Add ``pyramid.interfaces.ITemplateRenderer`` interface to Interfaces API
5385   chapter (has ``implementation()`` method, required to be used when getting
5386   at Chameleon macros).
5387
5388 - Add a "Modifying Package Structure" section to the project narrative
5389   documentation chapter (explain turning a module into a package).
5390
5391 - Documentation was added for the new ``handler`` ZCML directive in the ZCML
5392   section.
5393
5394 Deprecations
5395 ------------
5396
5397 - ``pyramid.configuration.Configurator`` is now deprecated.  Use
5398   ``pyramid.config.Configurator``, passing its constructor
5399   ``autocommit=True`` instead.  The ``pyramid.configuration.Configurator``
5400   alias will live for a long time, as every application uses it, but its
5401   import now issues a deprecation warning.  The
5402   ``pyramid.config.Configurator`` class has the same API as
5403   ``pyramid.configuration.Configurator`` class, which it means to replace,
5404   except by default it is a *non-autocommitting* configurator. The
5405   now-deprecated ``pyramid.configuration.Configurator`` will autocommit every
5406   time a configuration method is called.
5407
5408   The ``pyramid.configuration`` module remains, but it is deprecated.  Use
5409   ``pyramid.config`` instead.
5410
5411 1.0a4 (2010-11-21)
5412 ==================
5413
5414 Features
5415 --------
5416
5417 - URL Dispatch now allows for replacement markers to be located anywhere
5418   in the pattern, instead of immediately following a ``/``.
5419
5420 - URL Dispatch now uses the form ``{marker}`` to denote a replace marker in
5421   the route pattern instead of ``:marker``. The old colon-style marker syntax
5422   is still accepted for backwards compatibility. The new format allows a
5423   regular expression for that marker location to be used instead of the
5424   default ``[^/]+``, for example ``{marker:\d+}`` is now valid to require the
5425   marker to be digits.
5426
5427 - Add a ``pyramid.url.route_path`` API, allowing folks to generate relative
5428   URLs.  Calling ``route_path`` is the same as calling
5429   ``pyramid.url.route_url`` with the argument ``_app_url`` equal to the empty
5430   string.
5431
5432 - Add a ``pyramid.request.Request.route_path`` API.  This is a convenience
5433   method of the request which calls ``pyramid.url.route_url``.
5434
5435 - Make test suite pass on Jython (requires PasteScript trunk, presumably to
5436   be 1.7.4).
5437
5438 - Make test suite pass on PyPy (Chameleon doesn't work).
5439
5440 - Surrounding application configuration with ``config.begin()`` and
5441   ``config.end()`` is no longer necessary.  All paster templates have been
5442   changed to no longer call these functions.
5443
5444 - Fix configurator to not convert ``ImportError`` to ``ConfigurationError``
5445   if the import that failed was unrelated to the import requested via a
5446   dotted name when resolving dotted names (such as view dotted names).
5447
5448 Documentation
5449 -------------
5450
5451 - SQLAlchemy+URLDispatch and ZODB+Traversal tutorials have been updated to
5452   not call ``config.begin()`` or ``config.end()``.
5453
5454 Bug Fixes
5455 ---------
5456
5457 - Add deprecation warnings to import of ``pyramid.chameleon_text`` and
5458   ``pyramid.chameleon_zpt`` of ``get_renderer``, ``get_template``,
5459   ``render_template``, and ``render_template_to_response``.
5460
5461 - Add deprecation warning for import of ``pyramid.zcml.zcml_configure`` and
5462   ``pyramid.zcml.file_configure``.
5463
5464 - The ``pyramid_alchemy`` paster template had a typo, preventing an import
5465   from working.
5466
5467 - Fix apparent failures when calling ``pyramid.traversal.find_model(root,
5468   path)`` or ``pyramid.traversal.traverse(path)`` when ``path`` is
5469   (erroneously) a Unicode object. The user is meant to pass these APIs a
5470   string object, never a Unicode object.  In practice, however, users indeed
5471   pass Unicode.  Because the string that is passed must be ASCII encodeable,
5472   now, if they pass a Unicode object, its data is eagerly converted to an
5473   ASCII string rather than being passed along to downstream code as a
5474   convenience to the user and to prevent puzzling second-order failures from
5475   cropping up (all failures will occur within ``pyramid.traversal.traverse``
5476   rather than later down the line as the result of calling e.g.
5477   ``traversal_path``).
5478
5479 Backwards Incompatibilities
5480 ---------------------------
5481
5482 - The ``pyramid.testing.zcml_configure`` API has been removed.  It had been
5483   advertised as removed since repoze.bfg 1.2a1, but hadn't actually been.
5484
5485 Deprecations
5486 ------------
5487
5488 - The ``pyramid.settings.get_settings`` API is now deprecated.  Use
5489   ``pyramid.threadlocals.get_current_registry().settings`` instead or use the
5490   ``settings`` attribute of the registry available from the request
5491   (``request.registry.settings``).
5492
5493 Documentation
5494 -------------
5495
5496 - Removed ``zodbsessions`` tutorial chapter.  It's still useful, but we now
5497   have a SessionFactory abstraction which competes with it, and maintaining
5498   documentation on both ways to do it is a distraction.
5499
5500 Internal
5501 --------
5502
5503 - Replace Twill with WebTest in internal integration tests (avoid deprecation
5504   warnings generated by Twill).
5505
5506 1.0a3 (2010-11-16)
5507 ==================
5508
5509 Features
5510 --------
5511
5512 - Added Mako TemplateLookup settings for ``mako.error_handler``,
5513   ``mako.default_filters``, and ``mako.imports``.
5514
5515 - Normalized all paster templates: each now uses the name ``main`` to
5516   represent the function that returns a WSGI application, each now uses
5517   WebError, each now has roughly the same shape of development.ini style.
5518
5519 - Added class vars ``matchdict`` and ``matched_route`` to
5520   ``pyramid.request.Request``.  Each is set to ``None``.
5521
5522 - New API method: ``pyramid.settings.asbool``.
5523
5524 - New API methods for ``pyramid.request.Request``: ``model_url``,
5525   ``route_url``, and ``static_url``.  These are simple passthroughs for their
5526   respective functions in ``pyramid.url``.
5527
5528 - The ``settings`` object which used to be available only when
5529   ``request.settings.get_settings`` was called is now available as
5530   ``registry.settings`` (e.g. ``request.registry.settings`` in view code).
5531
5532 Bug Fixes
5533 ---------
5534
5535 - The pylons_* paster templates erroneously used the ``{squiggly}`` routing
5536   syntax as the pattern supplied to ``add_route``.  This style of routing is
5537   not supported.  They were replaced with ``:colon`` style route patterns.
5538
5539 - The pylons_* paster template used the same string
5540   (``your_app_secret_string``) for the ``session.secret`` setting in the
5541   generated ``development.ini``.  This was a security risk if left unchanged
5542   in a project that used one of the templates to produce production
5543   applications.  It now uses a randomly generated string.
5544
5545 Documentation
5546 -------------
5547
5548 - ZODB+traversal wiki (``wiki``) tutorial updated due to changes to
5549   ``pyramid_zodb`` paster template.
5550
5551 - SQLAlchemy+urldispach wiki (``wiki2``) tutorial updated due to changes to
5552   ``pyramid_routesalchemy`` paster template.
5553
5554 - Documented the ``matchdict`` and ``matched_route`` attributes of the
5555   request object in the Request API documentation.
5556
5557 Deprecations
5558 ------------
5559
5560 - Obtaining the ``settings`` object via
5561   ``registry.{get|query}Utility(ISettings)`` is now deprecated.  Instead,
5562   obtain the ``settings`` object via the ``registry.settings`` attribute.  A
5563   backwards compatibility shim was added to the registry object to register
5564   the settings object as an ISettings utility when ``setattr(registry,
5565   'settings', foo)`` is called, but it will be removed in a later release.
5566
5567 - Obtaining the ``settings`` object via ``pyramid.settings.get_settings`` is
5568   now deprecated.  Obtain it as the ``settings`` attribute of the registry
5569   now (obtain the registry via ``pyramid.threadlocal.get_registry`` or as
5570   ``request.registry``).
5571
5572 Behavior Differences
5573 --------------------
5574
5575 - Internal: ZCML directives no longer call get_current_registry() if there's
5576   a ``registry`` attribute on the ZCML context (kill off use of
5577   threadlocals).
5578
5579 - Internal: Chameleon template renderers now accept two arguments: ``path``
5580   and ``lookup``.  ``Lookup`` will be an instance of a lookup class which
5581   supplies (late-bound) arguments for debug, reload, and translate.  Any
5582   third-party renderers which use (the non-API) function
5583   ``pyramid.renderers.template_renderer_factory`` will need to adjust their
5584   implementations to obey the new callback argument list.  This change was to
5585   kill off inappropriate use of threadlocals.
5586
5587 1.0a2 (2010-11-09)
5588 ==================
5589
5590 Documentation
5591 -------------
5592
5593 - All references to events by interface
5594   (e.g. ``pyramid.interfaces.INewRequest``) have been changed to reference
5595   their concrete classes (e.g. ``pyramid.events.NewRequest``) in
5596   documentation about making subscriptions.
5597
5598 - All references to Pyramid-the-application were changed from mod-`pyramid`
5599   to app-`Pyramid`.  A custom role setting was added to ``docs/conf.py`` to
5600   allow for this.  (internal)
5601
5602 1.0a1 (2010-11-05)
5603 ==================
5604
5605 Features (delta from BFG 1.3)
5606 -------------------------------
5607
5608 - Mako templating renderer supports resource specification format for
5609   template lookups and within Mako templates. Absolute filenames must
5610   be used in Pyramid to avoid this lookup process.
5611
5612 - Add ``pyramid.httpexceptions`` module, which is a facade for the
5613   ``webob.exc`` module.
5614
5615 - Direct built-in support for the Mako templating language.
5616
5617 - A new configurator method exists: ``add_handler``.  This method adds
5618   a Pylons-style "view handler" (such a thing used to be called a
5619   "controller" in Pylons 1.0).
5620
5621 - New argument to configurator: ``session_factory``.
5622
5623 - New method on configurator: ``set_session_factory``
5624
5625 - Using ``request.session`` now returns a (dictionary-like) session
5626   object if a session factory has been configured.
5627
5628 - The request now has a new attribute: ``tmpl_context`` for benefit of
5629   Pylons users.
5630
5631 - The decorator previously known as ``pyramid.view.bfg_view`` is now
5632   known most formally as ``pyramid.view.view_config`` in docs and
5633   paster templates.  An import of ``pyramid.view.bfg_view``, however,
5634   will continue to work "forever".
5635
5636 - New API methods in ``pyramid.session``: ``signed_serialize`` and
5637   ``signed_deserialize``.
5638
5639 - New interface: ``pyramid.interfaces.IRendererInfo``.  An object of this type
5640   is passed to renderer factory constructors (see "Backwards
5641   Incompatibilities").
5642
5643 - New event type: ``pyramid.interfaces.IBeforeRender``.  An object of this type
5644   is sent as an event before a renderer is invoked (but after the
5645   application-level renderer globals factory added via
5646   ``pyramid.configurator.configuration.set_renderer_globals_factory``, if any,
5647   has injected its own keys).  Applications may now subscribe to the
5648   ``IBeforeRender`` event type in order to introspect the and modify the set of
5649   renderer globals before they are passed to a renderer.  The event object
5650   iself has a dictionary-like interface that can be used for this purpose.  For
5651   example::
5652
5653     from repoze.events import subscriber
5654     from pyramid.interfaces import IRendererGlobalsEvent
5655
5656     @subscriber(IRendererGlobalsEvent)
5657     def add_global(event):
5658         event['mykey'] = 'foo'
5659
5660   If a subscriber attempts to add a key that already exist in the renderer
5661   globals dictionary, a ``KeyError`` is raised.  This limitation is due to the
5662   fact that subscribers cannot be ordered relative to each other.  The set of
5663   keys added to the renderer globals dictionary by all subscribers and
5664   app-level globals factories must be unique.
5665
5666 - New class: ``pyramid.response.Response``.  This is a pure facade for
5667   ``webob.Response`` (old code need not change to use this facade, it's
5668   existence is mostly for vanity and documentation-generation purposes).
5669
5670 - All preexisting paster templates (except ``zodb``) now use "imperative"
5671   configuration (``starter``, ``routesalchemy``, ``alchemy``).
5672
5673 - A new paster template named ``pyramid_starter_zcml`` exists, which uses
5674   declarative configuration.
5675
5676 Documentation (delta from BFG 1.3)
5677 -----------------------------------
5678
5679 - Added a ``pyramid.httpexceptions`` API documentation chapter.
5680
5681 - Added a ``pyramid.session`` API documentation chapter.
5682
5683 - Added a ``Session Objects`` narrative documentation chapter.
5684
5685 - Added an API chapter for the ``pyramid.personality`` module.
5686
5687 - Added an API chapter for the ``pyramid.response`` module.
5688
5689 - All documentation which previously referred to ``webob.Response`` now uses
5690   ``pyramid.response.Response`` instead.
5691
5692 - The documentation has been overhauled to use imperative configuration,
5693   moving declarative configuration (ZCML) explanations to a separate
5694   narrative chapter ``declarative.rst``.
5695
5696 - The ZODB Wiki tutorial was updated to take into account changes to the
5697   ``pyramid_zodb`` paster template.
5698
5699 - The SQL Wiki tutorial was updated to take into account changes to the
5700   ``pyramid_routesalchemy`` paster template.
5701
5702 Backwards Incompatibilities (with BFG 1.3)
5703 ------------------------------------------
5704
5705 - There is no longer an ``IDebugLogger`` registered as a named utility
5706   with the name ``repoze.bfg.debug``.
5707
5708 - The logger which used to have the name of ``repoze.bfg.debug`` now
5709   has the name ``pyramid.debug``.
5710
5711 - The deprecated API ``pyramid.testing.registerViewPermission``
5712   has been removed.
5713
5714 - The deprecated API named ``pyramid.testing.registerRoutesMapper``
5715   has been removed.
5716
5717 - The deprecated API named ``pyramid.request.get_request`` was removed.
5718
5719 - The deprecated API named ``pyramid.security.Unauthorized`` was
5720   removed.
5721
5722 - The deprecated API named ``pyramid.view.view_execution_permitted``
5723   was removed.
5724
5725 - The deprecated API named ``pyramid.view.NotFound`` was removed.
5726
5727 - The ``bfgshell`` paster command is now named ``pshell``.
5728
5729 - The Venusian "category" for all built-in Venusian decorators
5730   (e.g. ``subscriber`` and ``view_config``/``bfg_view``) is now
5731   ``pyramid`` instead of ``bfg``.
5732
5733 - ``pyramid.renderers.rendered_response`` function removed; use
5734   ``render_pyramid.renderers.render_to_response`` instead.
5735
5736 - Renderer factories now accept a *renderer info object* rather than an
5737   absolute resource specification or an absolute path.  The object has the
5738   following attributes: ``name`` (the ``renderer=`` value), ``package`` (the
5739   'current package' when the renderer configuration statement was found),
5740   ``type``: the renderer type, ``registry``: the current registry, and
5741   ``settings``: the deployment settings dictionary.
5742
5743   Third-party ``repoze.bfg`` renderer implementations that must be ported to
5744   Pyramid will need to account for this.
5745
5746   This change was made primarily to support more flexible Mako template
5747   rendering.
5748
5749 - The presence of the key ``repoze.bfg.message`` in the WSGI environment when
5750   an exception occurs is now deprecated.  Instead, code which relies on this
5751   environ value should use the ``exception`` attribute of the request
5752   (e.g. ``request.exception[0]``) to retrieve the message.
5753
5754 - The values ``bfg_localizer`` and ``bfg_locale_name`` kept on the request
5755   during internationalization for caching purposes were never APIs.  These
5756   however have changed to ``localizer`` and ``locale_name``, respectively.
5757
5758 - The default ``cookie_name`` value of the ``authtktauthenticationpolicy`` ZCML
5759   now defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``).
5760
5761 - The default ``cookie_name`` value of the
5762   ``pyramid.authentication.AuthTktAuthenticationPolicy`` constructor now
5763   defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``).
5764
5765 - The ``request_type`` argument to the ``view`` ZCML directive, the
5766   ``pyramid.configuration.Configurator.add_view`` method, or the
5767   ``pyramid.view.view_config`` decorator (nee ``bfg_view``) is no longer
5768   permitted to be one of the strings ``GET``, ``HEAD``, ``PUT``, ``POST`` or
5769   ``DELETE``, and now must always be an interface.  Accepting the
5770   method-strings as ``request_type`` was a backwards compatibility strategy
5771   servicing repoze.bfg 1.0 applications.  Use the ``request_method``
5772   parameter instead to specify that a view a string request-method predicate.
4cdffc 5773