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