Michael Merickel
2015-02-06 a0a840979652d490ee642287d0edea94e8ca0dc4
commit | author | age
c61755 1 Next release
CM 2 ============
3
9177d0 4 Features
CR 5 --------
6
bc8e4d 7 - Added support / testing for 'pypy3' under Tox and Travis.
782eb4 8   See https://github.com/Pylons/pyramid/pull/1469
bc8e4d 9
9177d0 10 - Cache busting for static resources has been added and is available via a new
15b979 11   argument to ``pyramid.config.Configurator.add_static_view``: ``cachebust``.
ab2a77 12   See https://github.com/Pylons/pyramid/pull/1380
9177d0 13
ae6c88 14 - Add ``pyramid.config.Configurator.root_package`` attribute and init
MM 15   parameter to assist with includeable packages that wish to resolve
16   resources relative to the package in which the ``Configurator`` was created.
73b162 17   This is especially useful for addons that need to load asset specs from
c617b7 18   settings, in which case it is may be natural for a developer to define
MM 19   imports or assets relative to the top-level package.
ae6c88 20   See https://github.com/Pylons/pyramid/pull/1337
MM 21
ba5444 22 - Added line numbers to the log formatters in the scaffolds to assist with
MM 23   debugging. See https://github.com/Pylons/pyramid/pull/1326
24
7dd390 25 - Add new HTTP exception objects for status codes
MM 26   ``428 Precondition Required``, ``429 Too Many Requests`` and
27   ``431 Request Header Fields Too Large`` in ``pyramid.httpexceptions``.
28   See https://github.com/Pylons/pyramid/pull/1372/files
29
f3a567 30 - The ``pshell`` script will now load a ``PYTHONSTARTUP`` file if one is
MM 31   defined in the environment prior to launching the interpreter.
823ac4 32   See https://github.com/Pylons/pyramid/pull/1448
0c5e5a 33
7b1d42 34 - Make it simple to define notfound and forbidden views that wish to use
MM 35   the default exception-response view but with altered predicates and other
36   configuration options. The ``view`` argument is now optional in
37   ``config.add_notfound_view`` and ``config.add_forbidden_view``..
38   See https://github.com/Pylons/pyramid/issues/494
39
c617b7 40 - Greatly improve the readability of the ``pcreate`` shell script output.
MM 41   See https://github.com/Pylons/pyramid/pull/1453
42
716a20 43 - Improve robustness to timing attacks in the ``AuthTktCookieHelper`` and
MM 44   the ``SignedCookieSessionFactory`` classes by using the stdlib's
45   ``hmac.compare_digest`` if it is available (such as Python 2.7.7+ and 3.3+).
46   See https://github.com/Pylons/pyramid/pull/1457
889bdc 47
407b33 48 - Assets can now be overidden by an absolute path on the filesystem when using
8d5352 49   the ``config.override_asset`` API. This makes it possible to fully support
MM 50   serving up static content from a mutable directory while still being able
51   to use the ``request.static_url`` API and ``config.add_static_view``.
52   Previously it was not possible to use ``config.add_static_view`` with an
53   absolute path **and** generate urls to the content. This change replaces
54   the call, ``config.add_static_view('/abs/path', 'static')``, with
55   ``config.add_static_view('myapp:static', 'static')`` and
56   ``config.override_asset(to_override='myapp:static/',
57   override_with='/abs/path/')``. The ``myapp:static`` asset spec is completely
58   made up and does not need to exist - it is used for generating urls
59   via ``request.static_url('myapp:static/foo.png')``.
650d3d 60   See https://github.com/Pylons/pyramid/issues/1252
407b33 61
a62462 62 - Added ``pyramid.config.Configurator.set_response_factory`` and the
JA 63   ``response_factory`` keyword argument to the ``Configurator`` for defining
64   a factory that will return a custom ``Response`` class.
65   See https://github.com/Pylons/pyramid/pull/1499
66
2d659e 67 - Allow an iterator to be returned from a renderer. Previously it was only
MM 68   possible to return bytes or unicode.
69   See https://github.com/Pylons/pyramid/pull/1417
70
8dd970 71 - ``pserve`` can now take a ``-b`` or ``--browser`` option to open the server
MA 72   URL in a web browser. See https://github.com/Pylons/pyramid/pull/1533
73
3f8ac5 74 - Overall improvments for the ``proutes`` command. Added ``--format`` and
149ea9 75   ``--glob`` arguments to the command, introduced the ``method``
JA 76   column for displaying available request methods, and improved the ``view``
77   output by showing the module instead of just ``__repr__``.
78   See https://github.com/Pylons/pyramid/pull/1488
79
86f4d5 80 - Support keyword-only arguments and function annotations in views in
MM 81   Python 3. See https://github.com/Pylons/pyramid/pull/1556
82
c61755 83 Bug Fixes
8e90d6 84 ---------
a0e97b 85
8e90d6 86 - ``pyramid.wsgi.wsgiapp`` and ``pyramid.wsgi.wsgiapp2`` now raise
BJR 87   ``ValueError`` when accidentally passed ``None``.
ab2a77 88   See https://github.com/Pylons/pyramid/pull/1320
c61755 89
0cb759 90 - Fix an issue whereby predicates would be resolved as maybe_dotted in the
CM 91   introspectable but not when passed for registration. This would mean that
ab2a77 92   ``add_route_predicate`` for example can not take a string and turn it into
MM 93   the actual callable function.
94   See https://github.com/Pylons/pyramid/pull/1306
09beb2 95
d24055 96 - Fix ``pyramid.testing.setUp`` to return a ``Configurator`` with a proper
MM 97   package. Previously it was not possible to do package-relative includes
98   using the returned ``Configurator`` during testing. There is now a
99   ``package`` argument that can override this behavior as well.
ab2a77 100   See https://github.com/Pylons/pyramid/pull/1322
d24055 101
dc9c38 102 - Fix an issue where a ``pyramid.response.FileResponse`` may apply a charset
MM 103   where it does not belong. See https://github.com/Pylons/pyramid/pull/1251
104
326021 105 - Work around a bug introduced in Python 2.7.7 on Windows where
CM 106   ``mimetypes.guess_type`` returns Unicode rather than str for the content
107   type, unlike any previous version of Python.  See
108   https://github.com/Pylons/pyramid/issues/1360 for more information.
109
18566a 110 - ``pcreate`` now normalizes the package name by converting hyphens to
MM 111   underscores. See https://github.com/Pylons/pyramid/pull/1376
112
909486 113 - Fix an issue with the final response/finished callback being unable to
MM 114   add another callback to the list. See
115   https://github.com/Pylons/pyramid/pull/1373
116
46a268 117 - Fix a failing unittest caused by differing mimetypes across various OSs.
MM 118   See https://github.com/Pylons/pyramid/issues/1405
119
e7745a 120 - Fix route generation for static view asset specifications having no path.
RL 121   See https://github.com/Pylons/pyramid/pull/1377
122
1ef35b 123 - Allow the ``pyramid.renderers.JSONP`` renderer to work even if there is no
MM 124   valid request object. In this case it will not wrap the object in a
125   callback and thus behave just like the ``pyramid.renderers.JSON` renderer.
126   See https://github.com/Pylons/pyramid/pull/1561
127
3ffd40 128 Deprecations
MM 129 ------------
130
131 - Renamed the ``principal`` argument to ``pyramid.security.remember()`` to
132   ``userid`` in order to clarify its intended purpose.
133   See https://github.com/Pylons/pyramid/pull/1399
134
7a6bf6 135 Docs
CM 136 ----
137
63366c 138 - Moved the documentation for ``accept`` on ``Configurator.add_view`` to no
c015da 139   longer be part of the predicate list. See
63366c 140   https://github.com/Pylons/pyramid/issues/1391 for a bug report stating
BJR 141   ``not_`` was failing on ``accept``. Discussion with @mcdonc led to the
142   conclusion that it should not be documented as a predicate.
f17663 143   See https://github.com/Pylons/pyramid/pull/1487 for this PR
63366c 144
7a6bf6 145 - Removed logging configuration from Quick Tutorial ini files except for
CM 146   scaffolding- and logging-related chapters to avoid needing to explain it too
147   early.
a0e97b 148
dd4f73 149 - Clarify a previously-implied detail of the ``ISession.invalidate`` API
MM 150   documentation.
151
3ffd40 152 - Improve and clarify the documentation on what Pyramid defines as a
MM 153   ``principal`` and a ``userid`` in its security APIs.
154   See https://github.com/Pylons/pyramid/pull/1399
155
742397 156 Scaffolds
CM 157 ---------
158
159 - Update scaffold generating machinery to return the version of pyramid and
160   pyramid docs for use in scaffolds. Updated starter, alchemy and zodb
161   templates to have links to correctly versioned documentation and reflect
162   which pyramid was used to generate the scaffold.
163
93bc46 164 - Removed non-ascii copyright symbol from templates, as this was
FT 165   causing the scaffolds to fail for project generation.
166
a0e97b 167 1.5 (2014-04-08)
TS 168 ================
169
170 - Avoid crash in ``pserve --reload`` under Py3k, when iterating over possibly
171   mutated ``sys.modules``.
172
adcacf 173 - ``UnencryptedCookieSessionFactoryConfig`` failed if the secret contained
MM 174   higher order characters. See https://github.com/Pylons/pyramid/issues/1246
579a5f 175
e175ff 176 - Fixed a bug in ``UnencryptedCookieSessionFactoryConfig`` and
MM 177   ``SignedCookieSessionFactory`` where ``timeout=None`` would cause a new
178   session to always be created. Also in ``SignedCookieSessionFactory`` a
179   ``reissue_time=None`` would cause an exception when modifying the session.
180   See https://github.com/Pylons/pyramid/issues/1247
181
90600c 182 - Updated docs and scaffolds to keep in step with new 2.0 release of
aef68b 183   ``Lingua``.  This included removing all ``setup.cfg`` files from scaffolds
CM 184   and documentation environments.
90600c 185
579a5f 186 1.5b1 (2014-02-08)
CM 187 ==================
188
189 Features
190 --------
191
192 - We no longer eagerly clear ``request.exception`` and ``request.exc_info`` in
193   the exception view tween.  This makes it possible to inspect exception
194   information within a finished callback.  See
195   https://github.com/Pylons/pyramid/issues/1223.
196
2c205f 197 1.5a4 (2014-01-28)
CM 198 ==================
6b0d6f 199
480366 200 Features
BL 201 --------
202
203 - Updated scaffolds with new theme, fixed documentation and sample project.
204
6b0d6f 205 Bug Fixes
CM 206 ---------
207
e2600d 208 - Depend on a newer version of WebOb so that we pull in some crucial bug-fixes
BJR 209   that were showstoppers for functionality in Pyramid.
210
6b0d6f 211 - Add a trailing semicolon to the JSONP response. This fixes JavaScript syntax
CM 212   errors for old IE versions. See https://github.com/Pylons/pyramid/pull/1205
213
f58977 214 - Fix a memory leak when the configurator's ``set_request_property`` method was
CM 215   used or when the configurator's ``add_request_method`` method was used with
216   the ``property=True`` attribute.  See
217   https://github.com/Pylons/pyramid/issues/1212 .
218
5c4318 219 1.5a3 (2013-12-10)
CM 220 ==================
5065a5 221
ba419e 222 Features
MM 223 --------
224
0dcd56 225 - An authorization API has been added as a method of the
CM 226   request: ``request.has_permission``.
0184b5 227
CM 228   ``request.has_permission`` is a method-based alternative to the
229   ``pyramid.security.has_permission`` API and works exactly the same.  The
230   older API is now deprecated.
231
232 - Property API attributes have been added to the request for easier access to
233   authentication data: ``request.authenticated_userid``,
234   ``request.unauthenticated_userid``, and ``request.effective_principals``.
235
236   These are analogues, respectively, of
237   ``pyramid.security.authenticated_userid``,
238   ``pyramid.security.unauthenticated_userid``, and
239   ``pyramid.security.effective_principals``.  They operate exactly the same,
240   except they are attributes of the request instead of functions accepting a
241   request.  They are properties, so they cannot be assigned to.  The older
242   function-based APIs are now deprecated.
3c2f95 243
ba419e 244 - Pyramid's console scripts (``pserve``, ``pviews``, etc) can now be run
MM 245   directly, allowing custom arguments to be sent to the python interpreter
246   at runtime. For example::
247
248       python -3 -m pyramid.scripts.pserve development.ini
249
6b0889 250 - Added a specific subclass of ``HTTPBadRequest`` named
MM 251   ``pyramid.exceptions.BadCSRFToken`` which will now be raised in response
252   to failures in ``check_csrf_token``.
253   See https://github.com/Pylons/pyramid/pull/1149
254
63bf05 255 - Added a new ``SignedCookieSessionFactory`` which is very similar to the
ab579e 256   ``UnencryptedCookieSessionFactoryConfig`` but with a clearer focus on signing
CM 257   content. The custom serializer arguments to this function should only focus
258   on serializing, unlike its predecessor which required the serializer to also
259   perform signing.  See https://github.com/Pylons/pyramid/pull/1142 .  Note
260   that cookies generated using ``SignedCookieSessionFactory`` are not
261   compatible with cookies generated using ``UnencryptedCookieSessionFactory``,
262   so existing user session data will be destroyed if you switch to it.
63bf05 263
MM 264 - Added a new ``BaseCookieSessionFactory`` which acts as a generic cookie
265   factory that can be used by framework implementors to create their own
266   session implementations. It provides a reusable API which focuses strictly
267   on providing a dictionary-like object that properly handles renewals,
268   timeouts, and conformance with the ``ISession`` API.
838556 269   See https://github.com/Pylons/pyramid/pull/1142
63bf05 270
06aee8 271 - The anchor argument to ``pyramid.request.Request.route_url`` and
CM 272   ``pyramid.request.Request.resource_url`` and their derivatives will now be
ca419f 273   escaped via URL quoting to ensure minimal conformance.  See
06aee8 274   https://github.com/Pylons/pyramid/pull/1183
a3654e 275
MM 276 - Allow sending of ``_query`` and ``_anchor`` options to
277   ``pyramid.request.Request.static_url`` when an external URL is being
278   generated.
279   See https://github.com/Pylons/pyramid/pull/1183
280
06aee8 281 - You can now send a string as the ``_query`` argument to
CM 282   ``pyramid.request.Request.route_url`` and
283   ``pyramid.request.Request.resource_url`` and their derivatives.  When a
ca419f 284   string is sent instead of a list or dictionary. it is URL-quoted however it
CM 285   does not need to be in ``k=v`` form.  This is useful if you want to be able
286   to use a different query string format than ``x-www-form-urlencoded``.  See
287   https://github.com/Pylons/pyramid/pull/1183
06aee8 288
767e44 289 - ``pyramid.testing.DummyRequest`` now has a ``domain`` attribute to match the
CM 290   new WebOb 1.3 API.  Its value is ``example.com``.
291
073e52 292 Bug Fixes
CM 293 ---------
3c95b1 294
480366 295 - Fix the ``pcreate`` script so that when the target directory name ends with a
BL 296   slash it does not produce a non-working project directory structure.
297   Previously saying ``pcreate -s starter /foo/bar/`` produced different output
073e52 298   than  saying ``pcreate -s starter /foo/bar``.  The former did not work
CM 299   properly.
300
480366 301 - Fix the ``principals_allowed_by_permission`` method of
BL 302   ``ACLAuthorizationPolicy`` so it anticipates a callable ``__acl__``
678f49 303   on resources.  Previously it did not try to call the ``__acl__``
CM 304   if it was callable.
305
97f366 306 - The ``pviews`` script did not work when a url required custom request
MM 307   methods in order to perform traversal. Custom methods and descriptors added
308   via ``pyramid.config.Configurator.add_request_method`` will now be present,
309   allowing traversal to continue.
310   See https://github.com/Pylons/pyramid/issues/1104
311
422366 312 - Remove unused ``renderer`` argument from ``Configurator.add_route``.
CM 313
42f0cb 314 - Allow the ``BasicAuthenticationPolicy`` to work with non-ascii usernames
MM 315   and passwords. The charset is not passed as part of the header and different
316   browsers alternate between UTF-8 and Latin-1, so the policy now attempts
317   to decode with UTF-8 first, and will fallback to Latin-1.
318   See https://github.com/Pylons/pyramid/pull/1170
5065a5 319
642239 320 - The ``@view_defaults`` now apply to notfound and forbidden views
MM 321   that are defined as methods of a decorated class.
322   See https://github.com/Pylons/pyramid/issues/1173
323
5065a5 324 Documentation
PE 325 -------------
326
327 - Added a "Quick Tutorial" to go with the Quick Tour
328
480366 329 - Removed mention of ``pyramid_beaker`` from docs.  Beaker is no longer
66be39 330   maintained.  Point people at ``pyramid_redis_sessions`` instead.
CM 331
b04ae5 332 - Add documentation for ``pyramid.interfaces.IRendererFactory`` and
MM 333   ``pyramid.interfaces.IRenderer``.
334
af5fa0 335 Backwards Incompatibilities
MM 336 ---------------------------
337
338 - The key/values in the ``_query`` parameter of ``request.route_url`` and the
339   ``query`` parameter of ``request.resource_url`` (and their variants), used
340   to encode a value of ``None`` as the string ``'None'``, leaving the resulting
341   query string to be ``a=b&key=None``. The value is now dropped in this
79d9d6 342   situation, leaving a query string of ``a=b&key=``.
af5fa0 343   See https://github.com/Pylons/pyramid/issues/1119
MM 344
b04ae5 345 Deprecations
MM 346 ------------
347
d7550c 348 - Deprecate the ``pyramid.interfaces.ITemplateRenderer`` interface. It was
CM 349   ill-defined and became unused when Mako and Chameleon template bindings were
350   split into their own packages.
351
480366 352 - The ``pyramid.session.UnencryptedCookieSessionFactoryConfig`` API has been
BL 353   deprecated and is superseded by the
d79087 354   ``pyramid.session.SignedCookieSessionFactory``.  Note that while the cookies
CM 355   generated by the ``UnencryptedCookieSessionFactoryConfig``
356   are compatible with cookies generated by old releases, cookies generated by
480366 357   the SignedCookieSessionFactory are not. See
d79087 358   https://github.com/Pylons/pyramid/pull/1142
b04ae5 359
0184b5 360 - The ``pyramid.security.has_permission`` API is now deprecated.  Instead, use
CM 361   the newly-added ``has_permission`` method of the request object.
362
363 - The ``pyramid.security.effective_principals`` API is now deprecated.
364   Instead, use the newly-added ``effective_principals`` attribute of the
365   request object.
366
367 - The ``pyramid.security.authenticated_userid`` API is now deprecated.
368   Instead, use the newly-added ``authenticated_userid`` attribute of the
369   request object.
370
371 - The ``pyramid.security.unauthenticated_userid`` API is now deprecated.
372   Instead, use the newly-added ``unauthenticated_userid`` attribute of the
373   request object.
374
767e44 375 Dependencies
CM 376 ------------
377
378 - Pyramid now depends on WebOb>=1.3 (it uses ``webob.cookies.CookieProfile``
379   from 1.3+).
380
78b41e 381 1.5a2 (2013-09-22)
CM 382 ==================
f6f1d1 383
c390f4 384 Features
BJR 385 --------
386
cbcd4d 387 - Users can now provide dotted Python names to as the ``factory`` argument
480366 388   the Configurator methods named ``add_{view,route,subscriber}_predicate``
BL 389   (instead of passing the predicate factory directly, you can pass a
cbcd4d 390   dotted name which refers to the factory).
c390f4 391
c062d5 392 Bug Fixes
DH 393 ---------
394
f504cc 395 - Fix an exception in ``pyramid.path.package_name`` when resolving the package
CM 396   name for namespace packages that had no ``__file__`` attribute.
c062d5 397
f6f1d1 398 Backwards Incompatibilities
MM 399 ---------------------------
400
0778ee 401 - Pyramid no longer depends on or configures the Mako and Chameleon templating
CM 402   system renderers by default.  Disincluding these templating systems by
403   default means that the Pyramid core has fewer dependencies and can run on
404   future platforms without immediate concern for the compatibility of its
405   templating add-ons.  It also makes maintenance slightly more effective, as
406   different people can maintain the templating system add-ons that they
407   understand and care about without needing commit access to the Pyramid core,
408   and it allows users who just don't want to see any packages they don't use
409   come along for the ride when they install Pyramid.
82f970 410
0778ee 411   This means that upon upgrading to Pyramid 1.5a2+, projects that use either
CM 412   of these templating systems will see a traceback that ends something like
413   this when their application attempts to render a Chameleon or Mako template::
414
415      ValueError: No such renderer factory .pt
416
417   Or::
418
419      ValueError: No such renderer factory .mako
420
421   Or::
422
423      ValueError: No such renderer factory .mak
424
480366 425   Support for Mako templating has been moved into an add-on package named
BL 426   ``pyramid_mako``, and support for Chameleon templating has been moved into
427   an add-on package named ``pyramid_chameleon``.  These packages are drop-in
428   replacements for the old built-in support for these templating langauges.
0778ee 429   All you have to do is install them and make them active in your configuration
CM 430   to register renderer factories for ``.pt`` and/or ``.mako`` (or ``.mak``) to
431   make your application work again.
432
433   To re-add support for Chameleon and/or Mako template renderers into your
434   existing projects, follow the below steps.
435
436   If you depend on Mako templates:
437
438   * Make sure the ``pyramid_mako`` package is installed.  One way to do this
439     is by adding ``pyramid_mako`` to the ``install_requires`` section of your
440     package's ``setup.py`` file and afterwards rerunning ``setup.py develop``::
ce138c 441
MM 442         setup(
443             #...
444             install_requires=[
445                 'pyramid_mako',         # new dependency
446                 'pyramid',
447                 #...
448             ],
449         )
82f970 450
480366 451   * Within the portion of your application which instantiates a Pyramid
BL 452     ``pyramid.config.Configurator`` (often the ``main()`` function in
453     your project's ``__init__.py`` file), tell Pyramid to include the
0778ee 454     ``pyramid_mako`` includeme::
82f970 455
0778ee 456         config = Configurator(.....)
CM 457         config.include('pyramid_mako')
458
459   If you depend on Chameleon templates:
460
461   * Make sure the ``pyramid_chameleon`` package is installed.  One way to do
462     this is by adding ``pyramid_chameleon`` to the ``install_requires`` section
480366 463     of your package's ``setup.py`` file and afterwards rerunning
0778ee 464     ``setup.py develop``::
CM 465
466         setup(
467             #...
468             install_requires=[
469                 'pyramid_chameleon',         # new dependency
470                 'pyramid',
471                 #...
472             ],
473         )
474
480366 475   * Within the portion of your application which instantiates a Pyramid
BL 476     ``~pyramid.config.Configurator`` (often the ``main()`` function in
477     your project's ``__init__.py`` file), tell Pyramid to include the
0778ee 478     ``pyramid_chameleon`` includeme::
CM 479
480         config = Configurator(.....)
82f970 481         config.include('pyramid_chameleon')
MM 482
0778ee 483   Note that it's also fine to install these packages into *older* Pyramids for
CM 484   forward compatibility purposes.  Even if you don't upgrade to Pyramid 1.5
485   immediately, performing the above steps in a Pyramid 1.4 installation is
486   perfectly fine, won't cause any difference, and will give you forward
487   compatibility when you eventually do upgrade to Pyramid 1.5.
9ed074 488
0778ee 489   With the removal of Mako and Chameleon support from the core, some
480366 490   unit tests that use the ``pyramid.renderers.render*`` methods may begin to
BL 491   fail.  If any of your unit tests are invoking either
0778ee 492   ``pyramid.renderers.render()``  or ``pyramid.renderers.render_to_response()``
480366 493   with either Mako or Chameleon templates then the
0778ee 494   ``pyramid.config.Configurator`` instance in effect during
CM 495   the unit test should be also be updated to include the addons, as shown
496   above. For example::
9ed074 497
0778ee 498         class ATest(unittest.TestCase):
CM 499             def setUp(self):
500                 self.config = pyramid.testing.setUp()
501                 self.config.include('pyramid_mako')
82f970 502
0778ee 503             def test_it(self):
CM 504                 result = pyramid.renderers.render('mypkg:templates/home.mako', {})
505
506   Or::
507
508         class ATest(unittest.TestCase):
509             def setUp(self):
510                 self.config = pyramid.testing.setUp()
511                 self.config.include('pyramid_chameleon')
512
513             def test_it(self):
514                 result = pyramid.renderers.render('mypkg:templates/home.pt', {})
515
516 - If you're using the Pyramid debug toolbar, when you upgrade Pyramid to
480366 517   1.5a2+, you'll also need to upgrade the ``pyramid_debugtoolbar`` package to
BL 518   at least version 1.0.8, as older toolbar versions are not compatible with
519   Pyramid 1.5a2+ due to the removal of Mako support from the core.  It's
0778ee 520   fine to use this newer version of the toolbar code with older Pyramids too.
ec0c5c 521
f6f1d1 522 - Removed the ``request.response_*`` varying attributes. These attributes
MM 523   have been deprecated since Pyramid 1.1, and as per the deprecation policy,
524   have now been removed.
525
480366 526 - ``request.response`` will no longer be mutated when using the
BL 527   ``pyramid.renderers.render()`` API.  Almost all renderers mutate the
fbdc3a 528   ``request.response`` response object (for example, the JSON renderer sets
MM 529   ``request.response.content_type`` to ``application/json``), but this is
530   only necessary when the renderer is generating a response; it was a bug
531   when it was done as a side effect of calling ``pyramid.renderers.render()``.
f504cc 532
CM 533 - Removed the ``bfg2pyramid`` fixer script.
534
480366 535 - The ``pyramid.events.NewResponse`` event is now sent **after** response
fc477b 536   callbacks are executed.  It previously executed before response callbacks
CM 537   were executed.  Rationale: it's more useful to be able to inspect the response
538   after response callbacks have done their jobs instead of before.
539
2c4f4e 540 - Removed the class named ``pyramid.view.static`` that had been deprecated
CM 541   since Pyramid 1.1.  Instead use ``pyramid.static.static_view`` with
542   ``use_subpath=True`` argument.
543
780bbf 544 - Removed the ``pyramid.view.is_response`` function that had been deprecated
CM 545   since Pyramid 1.1.  Use the ``pyramid.request.Request.is_response`` method
546   instead.
547
fdf30b 548 - Removed the ability to pass the following arguments to
6c4293 549   ``pyramid.config.Configurator.add_route``: ``view``, ``view_context``.
fdf30b 550   ``view_for``, ``view_permission``, ``view_renderer``, and ``view_attr``.
CM 551   Using these arguments had been deprecated since Pyramid 1.1.  Instead of
552   passing view-related arguments to ``add_route``, use a separate call to
553   ``pyramid.config.Configurator.add_view`` to associate a view with a route
554   using its ``route_name`` argument.  Note that this impacts the
555   ``pyramid.config.Configurator.add_static_view`` function too, because it
556   delegates to ``add_route``.
557
8fe57d 558 - Removed the ability to influence and query a ``pyramid.request.Request``
CM 559   object as if it were a dictionary.  Previously it was possible to use methods
560   like ``__getitem__``, ``get``, ``items``, and other dictlike methods to
561   access values in the WSGI environment.  This behavior had been deprecated
562   since Pyramid 1.1.  Use methods of ``request.environ`` (a real dictionary)
563   instead.
564
95e971 565 - Removed ancient backwards compatibily hack in
CM 566   ``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of
567   the factory with the matchdict values for compatibility with BFG 0.9.
568
c6601f 569 - The ``renderer_globals_factory`` argument to the
CM 570   ``pyramid.config.Configurator` constructor and its ``setup_registry`` method
571   has been removed.  The ``set_renderer_globals_factory`` method of
572   ``pyramid.config.Configurator`` has also been removed.  The (internal)
573   ``pyramid.interfaces.IRendererGlobals`` interface was also removed.  These
574   arguments, methods and interfaces had been deprecated since 1.1.  Use a
575   ``BeforeRender`` event subscriber as documented in the "Hooks" chapter of the
576   Pyramid narrative documentation instead of providing renderer globals values
577   to the configurator.
578
75f385 579 Deprecations
CM 580 ------------
581
582 - The ``pyramid.config.Configurator.set_request_property`` method now issues
583   a deprecation warning when used.  It had been docs-deprecated in 1.4
584   but did not issue a deprecation warning when used.
585
00bb95 586 1.5a1 (2013-08-30)
CM 587 ==================
2d9314 588
MM 589 Features
590 --------
591
c5ed54 592 - A new http exception subclass named ``pyramid.httpexceptions.HTTPSuccessful``
CM 593   was added.  You can use this class as the ``context`` of an exception
480366 594   view to catch all 200-series "exceptions" (e.g. "raise HTTPOk").  This
c5ed54 595   also allows you to catch *only* the ``HTTPOk`` exception itself; previously
480366 596   this was impossible because a number of other exceptions
c5ed54 597   (such as ``HTTPNoContent``) inherited from ``HTTPOk``, but now they do not.
CM 598
0a4aed 599 - You can now generate "hybrid" urldispatch/traversal URLs more easily
480366 600   by using the new ``route_name``, ``route_kw`` and ``route_remainder_name``
c29603 601   arguments to  ``request.resource_url`` and ``request.resource_path``.  See
480366 602   the new section of the "Combining Traversal and URL Dispatch" documentation
c29603 603   chapter entitled  "Hybrid URL Generation".
0a4aed 604
480366 605 - It is now possible to escape double braces in Pyramid scaffolds (unescaped,
1930eb 606   these represent replacement values).  You can use ``\{\{a\}\}`` to
480366 607   represent a "bare" ``{{a}}``.  See
1930eb 608   https://github.com/Pylons/pyramid/pull/862
CM 609
330164 610 - Add ``localizer`` and ``locale_name`` properties (reified) to the request.
480366 611   See https://github.com/Pylons/pyramid/issues/508.  Note that the
330164 612   ``pyramid.i18n.get_localizer`` and ``pyramid.i18n.get_locale_name`` functions
CM 613   now simply look up these properties on the request.
c614ff 614
b210ce 615 - Add ``pdistreport`` script, which prints the Python version in use, the
CM 616   Pyramid version in use, and the version number and location of all Python
617   distributions currently installed.
618
32333e 619 - Add the ability to invert the result of any view, route, or subscriber
CM 620   predicate using the ``not_`` class.  For example::
621
622      from pyramid.config import not_
623
624      @view_config(route_name='myroute', request_method=not_('POST'))
625      def myview(request): ...
626
627   The above example will ensure that the view is called if the request method
628   is not POST (at least if no other view is more specific).
629
5e8ead 630   The ``pyramid.config.not_`` class can be used against any value that is
32333e 631   a predicate value passed in any of these contexts:
CM 632
633   - ``pyramid.config.Configurator.add_view``
634
635   - ``pyramid.config.Configurator.add_route``
636
637   - ``pyramid.config.Configurator.add_subscriber``
638
639   - ``pyramid.view.view_config``
640
641   - ``pyramid.events.subscriber``
642
a17863 643 - ``scripts/prequest.py``: add support for submitting ``PUT`` and ``PATCH``
CM 644   requests.  See https://github.com/Pylons/pyramid/pull/1033.  add support for
0d96b7 645   submitting ``OPTIONS`` and ``PROPFIND`` requests, and  allow users to specify
a17863 646   basic authentication credentials in the request via a ``--login`` argument to
CM 647   the script.  See https://github.com/Pylons/pyramid/pull/1039.
f0f92b 648
2d9314 649 - ``ACLAuthorizationPolicy`` supports ``__acl__`` as a callable. This
MM 650   removes the ambiguity between the potential ``AttributeError`` that would
651   be raised on the ``context`` when the property was not defined and the
652   ``AttributeError`` that could be raised from any user-defined code within
653   a dynamic property. It is recommended to define a dynamic ACL as a callable
654   to avoid this ambiguity. See https://github.com/Pylons/pyramid/issues/735.
655
ff41f8 656 - Allow a protocol-relative URL (e.g. ``//example.com/images``) to be passed to
WS 657   ``pyramid.config.Configurator.add_static_view``. This allows
658   externally-hosted static URLs to be generated based on the current protocol.
659
a1f768 660 - The ``AuthTktAuthenticationPolicy`` has two new options to configure its
480366 661   domain usage:
58c5fe 662
a1f768 663   * ``parent_domain``: if set the authentication cookie is set on
WA 664     the parent domain. This is useful if you have multiple sites sharing the
665     same domain.
666   * ``domain``: if provided the cookie is always set for this domain, bypassing
58c5fe 667     all usual logic.
TL 668
3ea788 669   See https://github.com/Pylons/pyramid/pull/1028,
TL 670   https://github.com/Pylons/pyramid/pull/1072 and
671   https://github.com/Pylons/pyramid/pull/1078.
188aa7 672
23a7c6 673 - The ``AuthTktAuthenticationPolicy`` now supports IPv6 addresses when using
MM 674   the ``include_ip=True`` option. This is possibly incompatible with
675   alternative ``auth_tkt`` implementations, as the specification does not
676   define how to properly handle IPv6. See
677   https://github.com/Pylons/pyramid/issues/831.
678
38844f 679 - Make it possible to use variable arguments via
MM 680   ``pyramid.paster.get_appsettings``. This also allowed the generated
681   ``initialize_db`` script from the ``alchemy`` scaffold to grow support
682   for options in the form ``a=1 b=2`` so you can fill in
683   values in a parameterized ``.ini`` file, e.g.
684   ``initialize_myapp_db etc/development.ini a=1 b=2``.
685   See https://github.com/Pylons/pyramid/pull/911
686
fab845 687 - The ``request.session.check_csrf_token()`` method and the ``check_csrf`` view
CM 688   predicate now take into account the value of the HTTP header named
689   ``X-CSRF-Token`` (as well as the ``csrf_token`` form parameter, which they
690   always did).  The header is tried when the form parameter does not exist.
691
b6a4d4 692 - View lookup will now search for valid views based on the inheritance
MM 693   hierarchy of the context. It tries to find views based on the most
694   specific context first, and upon predicate failure, will move up the
695   inheritance chain to test views found by the super-type of the context.
696   In the past, only the most specific type containing views would be checked
697   and if no matching view could be found then a PredicateMismatch would be
698   raised. Now predicate mismatches don't hide valid views registered on
5e8ead 699   super-types. Here's an example that now works::
9e1e6d 700
b6a4d4 701      class IResource(Interface):
07c189 702
b6a4d4 703          ...
9e1e6d 704
b6a4d4 705      @view_config(context=IResource)
MM 706      def get(context, request):
07c189 707
b6a4d4 708          ...
9e1e6d 709
b6a4d4 710      @view_config(context=IResource, request_method='POST')
MM 711      def post(context, request):
07c189 712
b6a4d4 713          ...
9e1e6d 714
b6a4d4 715      @view_config(context=IResource, request_method='DELETE')
MM 716      def delete(context, request):
07c189 717
b6a4d4 718          ...
9e1e6d 719
e01b1c 720      @implementer(IResource)
b6a4d4 721      class MyResource:
07c189 722
b6a4d4 723          ...
MM 724
725      @view_config(context=MyResource, request_method='POST')
726      def override_post(context, request):
07c189 727
b6a4d4 728          ...
9e1e6d 729
AL 730   Previously the override_post view registration would hide the get
731   and delete views in the context of MyResource -- leading to a
732   predicate mismatch error when trying to use GET or DELETE
733   methods. Now the views are found and no predicate mismatch is
734   raised.
6b9700 735   See https://github.com/Pylons/pyramid/pull/786 and
75fc4a 736   https://github.com/Pylons/pyramid/pull/1004 and
MM 737   https://github.com/Pylons/pyramid/pull/1046
9e1e6d 738
137748 739 - The ``pserve`` command now takes a ``-v`` (or ``--verbose``) flag and a
CM 740   ``-q`` (or ``--quiet``) flag.  Output from running ``pserve`` can be
741   controlled using these flags.  ``-v`` can be specified multiple times to
742   increase verbosity.  ``-q`` sets verbosity to ``0`` unconditionally.  The
743   default verbosity level is ``1``.
744
986dc5 745 - The ``alchemy`` scaffold tests now provide better coverage.  See
CM 746   https://github.com/Pylons/pyramid/pull/1029
747
d07d16 748 - The ``pyramid.config.Configurator.add_route`` method now supports being
CM 749   called with an external URL as pattern. See
480366 750   https://github.com/Pylons/pyramid/issues/611 and the documentation section
67674f 751   in the "URL Dispatch" chapter entitled "External Routes" for more information.
8a8eff 752
0d96b7 753 Bug Fixes
CM 754 ---------
755
97ed56 756 - It was not possible to use ``pyramid.httpexceptions.HTTPException`` as
CM 757   the ``context`` of an exception view as very general catchall for
480366 758   http-related exceptions when you wanted that exception view to override the
97ed56 759   default exception view.  See https://github.com/Pylons/pyramid/issues/985
CM 760
480366 761 - When the ``pyramid.reload_templates`` setting was true, and a Chameleon
BL 762   template was reloaded, and the renderer specification named a macro
8a7e80 763   (e.g. ``foo#macroname.pt``), renderings of the template after the template
480366 764   was reloaded due to a file change would produce the entire template body
BL 765   instead of just a rendering of the macro.  See
8a7e80 766   https://github.com/Pylons/pyramid/issues/1013.
CM 767
480366 768 - Fix an obscure problem when combining a virtual root with a route with a
ece96f 769   ``*traverse`` in its pattern.  Now the traversal path generated in
CM 770   such a configuration will be correct, instead of an element missing
771   a leading slash.
772
24c932 773 - Fixed a Mako renderer bug returning a tuple with a previous defname value
3de54e 774   in some circumstances. See https://github.com/Pylons/pyramid/issues/1037
BL 775   for more information.
24c932 776
0d96b7 777 - Make the ``pyramid.config.assets.PackageOverrides`` object implement the API
CM 778   for ``__loader__`` objects specified in PEP 302.  Proxies to the
779   ``__loader__`` set by the importer, if present; otherwise, raises
780   ``NotImplementedError``.  This makes Pyramid static view overrides work
781   properly under Python 3.3 (previously they would not).  See
782   https://github.com/Pylons/pyramid/pull/1015 for more information.
783
784 - ``mako_templating``: added defensive workaround for non-importability of
785   ``mako`` due to upstream ``markupsafe`` dropping Python 3.2 support.  Mako
786   templating will no longer work under the combination of MarkupSafe 0.17 and
787   Python 3.2 (although the combination of MarkupSafe 0.17 and Python 3.3 or any
788   supported Python 2 version will work OK).
789
ea278e 790 - Spaces and dots may now be in mako renderer template paths. This was
MM 791   broken when support for the new makodef syntax was added in 1.4a1.
792   See https://github.com/Pylons/pyramid/issues/950
793
20c57e 794 - ``pyramid.debug_authorization=true`` will now correctly print out
MM 795   ``Allowed`` for views registered with ``NO_PERMISSION_REQUIRED`` instead
796   of invoking the ``permits`` method of the authorization policy.
797   See https://github.com/Pylons/pyramid/issues/954
798
c35b29 799 - Pyramid failed to install on some systems due to being packaged with
MM 800   some test files containing higher order characters in their names. These
801   files have now been removed. See
802   https://github.com/Pylons/pyramid/issues/981
803
050b71 804 - ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so code under
0d96b7 805   Python 3 would use ``__len__`` to find truthiness; this usually caused an
CM 806   instance of DummyResource to be "falsy" instead of "truthy".  See
807   https://github.com/Pylons/pyramid/pull/1032
050b71 808
0a8d50 809 - The ``alchemy`` scaffold would break when the database was MySQL during
CM 810   tables creation.  See https://github.com/Pylons/pyramid/pull/1049
811
6a4a34 812 - The ``current_route_url`` method now attaches the query string to the URL by
JV 813   default. See
0f1bc5 814   https://github.com/Pylons/pyramid/issues/1040
33e0fe 815
d6e8b8 816 - Make ``pserve.cherrypy_server_runner`` Python 3 compatible. See
TL 817   https://github.com/Pylons/pyramid/issues/718
818
33e0fe 819 Backwards Incompatibilities
JV 820 ---------------------------
821
6a4a34 822 - Modified the ``current_route_url`` method in pyramid.Request. The method
JV 823   previously returned the URL without the query string by default, it now does
824   attach the query string unless it is overriden.
0f1bc5 825
480366 826 - The ``route_url`` and ``route_path`` APIs no longer quote ``/``
58951c 827   to ``%2F`` when a replacement value contains a ``/``.  This was pointless,
480366 828   as WSGI servers always unquote the slash anyway, and Pyramid never sees the
58951c 829   quoted value.
CM 830
480366 831 - It is no longer possible to set a ``locale_name`` attribute of the request,
330164 832   nor is it possible to set a ``localizer`` attribute of the request.  These
CM 833   are now "reified" properties that look up a locale name and localizer
834   respectively using the machinery described in the "Internationalization"
835   chapter of the documentation.
836
db0185 837 - If you send an ``X-Vhm-Root`` header with a value that ends with a slash (or
CM 838   any number of slashes), the trailing slash(es) will be removed before a URL
839   is generated when you use use ``request.resource_url`` or
840   ``request.resource_path``.  Previously the virtual root path would not have
841   trailing slashes stripped, which would influence URL generation.
842
843 - The ``pyramid.interfaces.IResourceURL`` interface has now grown two new
844   attributes: ``virtual_path_tuple`` and ``physical_path_tuple``.  These should
845   be the tuple form of the resource's path (physical and virtual).
846