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