Chris McDonough
2011-07-12 f55b54a16def0bb0c463ee302dd12eefaa3638ad
commit | author | age
a36fdb 1 1.1b1 (2011-07-10)
CM 2 ==================
0fa199 3
CM 4 Features
5 --------
6
756500 7 - It is now possible to invoke ``paster pshell`` even if the paste ini file
CM 8   section name pointed to in its argument is not actually a Pyramid WSGI
9   application.  The shell will work in a degraded mode, and will warn the
10   user.  See "The Interactive Shell" in the "Creating a Pyramid Project"
11   narrative documentation section.
12
13 - ``paster pshell`` now offers more built-in global variables by default
14   (including ``app`` and ``settings``).  See "The Interactive Shell" in the
15   "Creating a Pyramid Project" narrative documentation section.
16
17 - It is now possible to add a ``[pshell]`` section to your application's .ini
18   configuration file, which influences the global names available to a pshell
19   session.  See "Extending the Shell" in the "Creating a Pyramid Project"
20   narrative documentation chapter.
21
fca1ef 22 - The ``config.scan`` method has grown a ``**kw`` argument.  ``kw`` argument
CM 23   represents a set of keyword arguments to pass to the Venusian ``Scanner``
24   object created by Pyramid.  (See the Venusian documentation for more
25   information about ``Scanner``).
26
6a0602 27 - New request property: ``json_body``. This property will return the
CM 28   JSON-decoded variant of the request body.  If the request body is not
29   well-formed JSON, this property will raise an exception.
b78eff 30
0fa199 31 - A new value ``http_cache`` can be used as a view configuration
CM 32   parameter.
33
34   When you supply an ``http_cache`` value to a view configuration, the
35   ``Expires`` and ``Cache-Control`` headers of a response generated by the
36   associated view callable are modified.  The value for ``http_cache`` may be
37   one of the following:
38
39   - A nonzero integer.  If it's a nonzero integer, it's treated as a number
40     of seconds.  This number of seconds will be used to compute the
41     ``Expires`` header and the ``Cache-Control: max-age`` parameter of
42     responses to requests which call this view.  For example:
43     ``http_cache=3600`` instructs the requesting browser to 'cache this
44     response for an hour, please'.
45
46   - A ``datetime.timedelta`` instance.  If it's a ``datetime.timedelta``
47     instance, it will be converted into a number of seconds, and that number
48     of seconds will be used to compute the ``Expires`` header and the
49     ``Cache-Control: max-age`` parameter of responses to requests which call
50     this view.  For example: ``http_cache=datetime.timedelta(days=1)``
51     instructs the requesting browser to 'cache this response for a day,
52     please'.
53
54   - Zero (``0``).  If the value is zero, the ``Cache-Control`` and
55     ``Expires`` headers present in all responses from this view will be
56     composed such that client browser cache (and any intermediate caches) are
57     instructed to never cache the response.
58
59   - A two-tuple.  If it's a two tuple (e.g. ``http_cache=(1,
60     {'public':True})``), the first value in the tuple may be a nonzero
61     integer or a ``datetime.timedelta`` instance; in either case this value
62     will be used as the number of seconds to cache the response.  The second
63     value in the tuple must be a dictionary.  The values present in the
64     dictionary will be used as input to the ``Cache-Control`` response
65     header.  For example: ``http_cache=(3600, {'public':True})`` means 'cache
66     for an hour, and add ``public`` to the Cache-Control header of the
67     response'.  All keys and values supported by the
68     ``webob.cachecontrol.CacheControl`` interface may be added to the
69     dictionary.  Supplying ``{'public':True}`` is equivalent to calling
70     ``response.cache_control.public = True``.
71
72   Providing a non-tuple value as ``http_cache`` is equivalent to calling
73   ``response.cache_expires(value)`` within your view's body.
74
75   Providing a two-tuple value as ``http_cache`` is equivalent to calling
76   ``response.cache_expires(value[0], **value[1])`` within your view's body.
77
78   If you wish to avoid influencing, the ``Expires`` header, and instead wish
79   to only influence ``Cache-Control`` headers, pass a tuple as ``http_cache``
80   with the first element of ``None``, e.g.: ``(None, {'public':True})``.
81
b44aab 82 Bug Fixes
CM 83 ---------
84
85 - Framework wrappers of the original view (such as http_cached and so on)
86   relied on being able to trust that the response they were receiving was an
87   IResponse.  It wasn't always, because the response was resolved by the
88   router instead of early in the view wrapping process.  This has been fixed.
89
6a0602 90 Documentation
CM 91 -------------
92
93 - Added a section in the "Webob" chapter named "Dealing With A JSON-Encoded
94   Request Body" (usage of ``request.json_body``).
95
756500 96 Behavior Changes
CM 97 ----------------
98
99 - The ``paster pshell``, ``paster proutes``, and ``paster pviews`` commands
100   now take a single argument in the form ``/path/to/config.ini#sectionname``
101   rather than the previous 2-argument spelling ``/path/to/config.ini
102   sectionname``.  ``#sectionname`` may be omitted, in which case ``#main`` is
103   assumed.
104
b9c0e7 105 1.1a4 (2011-07-01)
CM 106 ==================
9395f0 107
CM 108 Bug Fixes
109 ---------
110
111 - ``pyramid.testing.DummyRequest`` now raises deprecation warnings when
112   attributes deprecated for ``pyramid.request.Request`` are accessed (like
113   ``response_content_type``).  This is for the benefit of folks running unit
114   tests which use DummyRequest instead of a "real" request, so they know
115   things are deprecated without necessarily needing a functional test suite.
116
2ea5c1 117 - The ``pyramid.events.subscriber`` directive behaved contrary to the
CM 118   documentation when passed more than one interface object to its
119   constructor.  For example, when the following listener was registered::
120
121      @subscriber(IFoo, IBar)
122      def expects_ifoo_events_and_ibar_events(event):
123          print event
124
125   The Events chapter docs claimed that the listener would be registered and
126   listening for both ``IFoo`` and ``IBar`` events.  Instead, it registered an
127   "object event" subscriber which would only be called if an IObjectEvent was
128   emitted where the object interface was ``IFoo`` and the event interface was
129   ``IBar``.
130
131   The behavior now matches the documentation. If you were relying on the
132   buggy behavior of the 1.0 ``subscriber`` directive in order to register an
133   object event subscriber, you must now pass a sequence to indicate you'd
8519c9 134   like to register a subscriber for an object event. e.g.::
2ea5c1 135
CM 136      @subscriber([IFoo, IBar])
137      def expects_object_event(object, event):
138          print object, event
139
c1f3d0 140 Features
CM 141 --------
142
143 - Add JSONP renderer (see "JSONP renderer" in the Renderers chapter of the
144   documentation).
145
b7f33b 146 Deprecations
CM 147 ------------
148
149 - Deprecated the ``set_renderer_globals_factory`` method of the Configurator
150   and the ``renderer_globals`` Configurator constructor parameter.
151
05a1b4 152 Documentation
CM 153 -------------
154
6c9959 155 - The Wiki and Wiki2 tutorial "Tests" chapters each had two bugs: neither did
CM 156   told the user to depend on WebTest, and 2 tests failed in each as the
157   result of changes to Pyramid itself.  These issues have been fixed.
05a1b4 158
e21ed8 159 - Move 1.0.X CHANGES.txt entries to HISTORY.txt.
CM 160
1ba6fe 161 1.1a3 (2011-06-26)
CM 162 ==================
05fd08 163
8bd6cf 164 Features
CM 165 --------
166
167 - Added ``mako.preprocessor`` config file parameter; allows for a Mako
168   preprocessor to be specified as a Python callable or Python dotted name.
169   See https://github.com/Pylons/pyramid/pull/183 for rationale.
170
05fd08 171 Bug fixes
CM 172 ---------
173
174 - Pyramid would raise an AttributeError in the Configurator when attempting
175   to set a ``__text__`` attribute on a custom predicate that was actually a
176   classmethod.  See https://github.com/Pylons/pyramid/pull/217 .
177
d8c55c 178 - Accessing or setting deprecated response_* attrs on request
CM 179   (e.g. ``response_content_type``) now issues a deprecation warning at access
180   time rather than at rendering time.
05fd08 181
cc85e7 182 1.1a2 (2011-06-22)
CM 183 ==================
c724f0 184
d74d53 185 Bug Fixes
CM 186 ---------
187
188 - 1.1a1 broke Akhet by not providing a backwards compatibility import shim
189   for ``pyramid.paster.PyramidTemplate``.  Now one has been added, although a
cc85e7 190   deprecation warning is emitted when Akhet imports it.
d74d53 191
6ed33e 192 - If multiple specs were provided in a single call to
CM 193   ``config.add_translation_dirs``, the directories were inserted into the
194   beginning of the directory list in the wrong order: they were inserted in
195   the reverse of the order they were provided in the ``*specs`` list (items
4f11dc 196   later in the list were added before ones earlier in the list).  This is now
CM 197   fixed.
6ed33e 198
c724f0 199 Backwards Incompatibilities
CM 200 ---------------------------
201
202 - The pyramid Router attempted to set a value into the key
203   ``environ['repoze.bfg.message']`` when it caught a view-related exception
cc85e7 204   for backwards compatibility with applications written for ``repoze.bfg``
CM 205   during error handling.  It did this by using code that looked like so::
c724f0 206
CM 207                     # "why" is an exception object
208                     try: 
209                         msg = why[0]
210                     except:
211                         msg = ''
212
213                     environ['repoze.bfg.message'] = msg
214
215   Use of the value ``environ['repoze.bfg.message']`` was docs-deprecated in
216   Pyramid 1.0.  Our standing policy is to not remove features after a
217   deprecation for two full major releases, so this code was originally slated
218   to be removed in Pyramid 1.2.  However, computing the
219   ``repoze.bfg.message`` value was the source of at least one bug found in
220   the wild (https://github.com/Pylons/pyramid/issues/199), and there isn't a
221   foolproof way to both preserve backwards compatibility and to fix the bug.
222   Therefore, the code which sets the value has been removed in this release.
223   Code in exception views which relies on this value's presence in the
224   environment should now use the ``exception`` attribute of the request
225   (e.g. ``request.exception[0]``) to retrieve the message instead of relying
226   on ``request.environ['repoze.bfg.message']``.
227
83549e 228 1.1a1 (2011-06-20)
CM 229 ==================
959523 230
8027ad 231 Documentation
JD 232 -------------
233
af71c2 234 - The term "template" used to refer to both "paster templates" and "rendered
CM 235   templates" (templates created by a rendering engine.  i.e. Mako, Chameleon,
236   Jinja, etc.).  "Paster templates" will now be refered to as "scaffolds",
237   whereas the name for "rendered templates" will remain as "templates."
8027ad 238
88f967 239 - The ``wiki`` (ZODB+Traversal) tutorial was updated slightly.
CM 240
241 - The ``wiki2`` (SQLA+URL Dispatch) tutorial was updated slightly.
242
d2973d 243 - Make ``pyramid.interfaces.IAuthenticationPolicy`` and
CM 244   ``pyramid.interfaces.IAuthorizationPolicy`` public interfaces, and refer to
245   them within the ``pyramid.authentication`` and ``pyramid.authorization``
246   API docs.
247
248 - Render the function definitions for each exposed interface in
249   ``pyramid.interfaces``.
250
cae85d 251 - Add missing docs reference to
CM 252   ``pyramid.config.Configurator.set_view_mapper`` and refer to it within
253   Hooks chapter section named "Using a View Mapper".
254
f6799b 255 - Added section to the "Environment Variables and ``.ini`` File Settings"
CM 256   chapter in the narrative documentation section entitled "Adding a Custom
257   Setting".
258
2a1c3f 259 - Added documentation for a "multidict" (e.g. the API of ``request.POST``) as
CM 260   interface API documentation.
261
e725cf 262 - Added a section to the "URL Dispatch" narrative chapter regarding the new
CM 263   "static" route feature.
264
2ce652 265 - Added "What's New in Pyramid 1.1" to HTML rendering of documentation.
CM 266
0ca4bb 267 - Added API docs for ``pyramid.authentication.SessionAuthenticationPolicy``.
CM 268
f8f08b 269 - Added API docs for ``pyramid.httpexceptions.exception_response``.
1ffb8e 270
CM 271 - Added "HTTP Exceptions" section to Views narrative chapter including a
f8f08b 272   description of ``pyramid.httpexceptions.exception_response``.
1ffb8e 273
fcbd7b 274 Features
CM 275 --------
4d9260 276
f3e62c 277 - Add support for language fallbacks: when trying to translate for a
WA 278   specific territory (such as ``en_GB``) fall back to translations
279   for the language (ie ``en``). This brings the translation behaviour in line
280   with GNU gettext and fixes partially translated texts when using C
281   extensions.
282
0ca4bb 283 - New authentication policy:
CM 284   ``pyramid.authentication.SessionAuthenticationPolicy``, which uses a session
285   to store credentials.
286
4d9260 287 - Accessing the ``response`` attribute of a ``pyramid.request.Request``
CM 288   object (e.g. ``request.response`` within a view) now produces a new
289   ``pyramid.response.Response`` object.  This feature is meant to be used
290   mainly when a view configured with a renderer needs to set response
db51c0 291   attributes: all renderers will use the Response object implied by
CM 292   ``request.response`` as the response object returned to the router.
293
294   ``request.response`` can also be used by code in a view that does not use a
295   renderer, however the response object that is produced by
296   ``request.response`` must be returned when a renderer is not in play (it is
297   not a "global" response).
fcbd7b 298
CM 299 - Integers and longs passed as ``elements`` to ``pyramid.url.resource_url``
300   or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context,
301   request, 1, 2)`` (``1`` and ``2`` are the ``elements``) will now be
302   converted implicitly to strings in the result.  Previously passing integers
303   or longs as elements would cause a TypeError.
304
296ee2 305 - ``pyramid_alchemy`` paster template now uses ``query.get`` rather than
CM 306   ``query.filter_by`` to take better advantage of identity map caching.
307
308 - ``pyramid_alchemy`` paster template now has unit tests.
309
2242e6 310 - Added ``pyramid.i18n.make_localizer`` API (broken out from
CM 311   ``get_localizer`` guts).
312
ba2ac1 313 - An exception raised by a NewRequest event subscriber can now be caught by
CM 314   an exception view.
315
b32552 316 - It is now possible to get information about why Pyramid raised a Forbidden
CM 317   exception from within an exception view.  The ``ACLDenied`` object returned
318   by the ``permits`` method of each stock authorization policy
319   (``pyramid.interfaces.IAuthorizationPolicy.permits``) is now attached to
320   the Forbidden exception as its ``result`` attribute.  Therefore, if you've
321   created a Forbidden exception view, you can see the ACE, ACL, permission,
322   and principals involved in the request as
323   eg. ``context.result.permission``, ``context.result.acl``, etc within the
324   logic of the Forbidden exception view.
325
474df5 326 - Don't explicitly prevent the ``timeout`` from being lower than the
CM 327   ``reissue_time`` when setting up an ``AuthTktAuthenticationPolicy``
328   (previously such a configuration would raise a ``ValueError``, now it's
329   allowed, although typically nonsensical).  Allowing the nonsensical
330   configuration made the code more understandable and required fewer tests.
331
99a32e 332 - A new paster command named ``paster pviews`` was added.  This command
CM 333   prints a summary of potentially matching views for a given path.  See the
334   section entitled "Displaying Matching Views for a Given URL" in the "View
335   Configuration" chapter of the narrative documentation for more information.
336
e725cf 337 - The ``add_route`` method of the Configurator now accepts a ``static``
CM 338   argument.  If this argument is ``True``, the added route will never be
339   considered for matching when a request is handled.  Instead, it will only
340   be useful for URL generation via ``route_url`` and ``route_path``.  See the
341   section entitled "Static Routes" in the URL Dispatch narrative chapter for
342   more information.
343
966b5c 344 - A default exception view for the context
99edc5 345   ``pyramid.interfaces.IExceptionResponse`` is now registered by default.
CM 346   This means that an instance of any exception response class imported from
347   ``pyramid.httpexceptions`` (such as ``HTTPFound``) can now be raised from
348   within view code; when raised, this exception view will render the
349   exception to a response.
1ffb8e 350
f8f08b 351 - A function named ``pyramid.httpexceptions.exception_response`` is a
CM 352   shortcut that can be used to create HTTP exception response objects using
353   an HTTP integer status code.
1ffb8e 354
CM 355 - The Configurator now accepts an additional keyword argument named
966b5c 356   ``exceptionresponse_view``.  By default, this argument is populated with a
CM 357   default exception view function that will be used when a response is raised
358   as an exception. When ``None`` is passed for this value, an exception view
359   for responses will not be registered.  Passing ``None`` returns the
360   behavior of raising an HTTP exception to that of Pyramid 1.0 (the exception
361   will propagate to middleware and to the WSGI server).
362
363 - The ``pyramid.request.Request`` class now has a ``ResponseClass`` interface
364   which points at ``pyramid.response.Response``.
365
8cbbd9 366 - The ``pyramid.response.Response`` class now has a ``RequestClass``
CM 367   interface which points at ``pyramid.request.Request``.
1ffb8e 368
d868ff 369 - It is now possible to return an arbitrary object from a Pyramid view
CM 370   callable even if a renderer is not used, as long as a suitable adapter to
371   ``pyramid.interfaces.IResponse`` is registered for the type of the returned
1a6fc7 372   object by using the new
CM 373   ``pyramid.config.Configurator.add_response_adapter`` API.  See the section
374   in the Hooks chapter of the documentation entitled "Changing How Pyramid
375   Treats View Responses".
df15ed 376
99edc5 377 - The Pyramid router will now, by default, call the ``__call__`` method of
CM 378   WebOb response objects when returning a WSGI response.  This means that,
379   among other things, the ``conditional_response`` feature of WebOb response
380   objects will now behave properly.
df15ed 381
920990 382 - New method named ``pyramid.request.Request.is_response``.  This method
CM 383   should be used instead of the ``pyramid.view.is_response`` function, which
384   has been deprecated.
e39ddf 385
JG 386 Bug Fixes
387 ---------
388
0fd8ea 389 - URL pattern markers used in URL dispatch are permitted to specify a custom
CM 390   regex. For example, the pattern ``/{foo:\d+}`` means to match ``/12345``
391   (foo==12345 in the match dictionary) but not ``/abc``. However, custom
0a0edf 392   regexes in a pattern marker which used squiggly brackets did not work. For
CM 393   example, ``/{foo:\d{4}}`` would fail to match ``/1234`` and
394   ``/{foo:\d{1,2}}`` would fail to match ``/1`` or ``/11``. One level of
395   inner squiggly brackets is now recognized so that the prior two patterns
396   given as examples now work. See also
397   https://github.com/Pylons/pyramid/issues/#issue/123.
398
399 - Don't send port numbers along with domain information in cookies set by
115c71 400   AuthTktCookieHelper (see https://github.com/Pylons/pyramid/issues/131).
CM 401
402 - ``pyramid.url.route_path`` (and the shortcut
403   ``pyramid.request.Request.route_url`` method) now include the WSGI
b596e1 404   SCRIPT_NAME at the front of the path if it is not empty (see
CM 405   https://github.com/Pylons/pyramid/issues/135).
406
407 - ``pyramid.testing.DummyRequest`` now has a ``script_name`` attribute (the
0b2629 408   empty string).
CM 409
410 - Don't quote ``:@&+$,`` symbols in ``*elements`` passed to
411   ``pyramid.url.route_url`` or ``pyramid.url.resource_url`` (see
412   https://github.com/Pylons/pyramid/issues#issue/141).
413
414 - Include SCRIPT_NAME in redirects issued by
415   ``pyramid.view.append_slash_notfound_view`` (see
416   https://github.com/Pylons/pyramid/issues#issue/149).
417
418 - Static views registered with ``config.add_static_view`` which also included
419   a ``permission`` keyword argument would not work as expected, because
420   ``add_static_view`` also registered a route factory internally.  Because a
421   route factory was registered internally, the context checked by the Pyramid
8af47b 422   permission machinery never had an ACL.  ``add_static_view`` no longer
CM 423   registers a route with a factory, so the default root factory will be used.
424
425 - ``config.add_static_view`` now passes extra keyword arguments it receives
426   to ``config.add_route`` (calling add_static_view is mostly logically
427   equivalent to adding a view of the type ``pyramid.static.static_view``
428   hooked up to a route with a subpath).  This makes it possible to pass e.g.,
29a850 429   ``factory=`` to ``add_static_view`` to protect a particular static view
CM 430   with a custom ACL.
431
432 - ``testing.DummyRequest`` used the wrong registry (the global registry) as
433   ``self.registry`` if a dummy request was created *before* ``testing.setUp``
434   was executed (``testing.setUp`` pushes a local registry onto the
435   threadlocal stack). Fixed by implementing ``registry`` as a property for
436   DummyRequest instead of eagerly assigning an attribute.
437   See also https://github.com/Pylons/pyramid/issues/165
438
ba0a5f 439 - When visiting a URL that represented a static view which resolved to a
CM 440   subdirectory, the ``index.html`` of that subdirectory would not be served
441   properly.  Instead, a redirect to ``/subdir`` would be issued.  This has
442   been fixed, and now visiting a subdirectory that contains an ``index.html``
443   within a static view returns the index.html properly.  See also
444   https://github.com/Pylons/pyramid/issues/67.
445
4d9260 446 - Redirects issued by a static view did not take into account any existing
CM 447   ``SCRIPT_NAME`` (such as one set by a url mapping composite).  Now they do.
448
449 - The ``pyramid.wsgi.wsgiapp2`` decorator did not take into account the
450   ``SCRIPT_NAME`` in the origin request.
451
452 - The ``pyramid.wsgi.wsgiapp2`` decorator effectively only worked when it
453   decorated a view found via traversal; it ignored the ``PATH_INFO`` that was
454   part of a url-dispatch-matched view.
455
456 Deprecations
457 ------------
458
459 - Deprecated all assignments to ``request.response_*`` attributes (for
460   example ``request.response_content_type = 'foo'`` is now deprecated).
ed7ffe 461   Assignments and mutations of assignable request attributes that were
CM 462   considered by the framework for response influence are now deprecated:
463   ``response_content_type``, ``response_headerlist``, ``response_status``,
464   ``response_charset``, and ``response_cache_for``.  Instead of assigning
465   these to the request object for later detection by the rendering machinery,
466   users should use the appropriate API of the Response object created by
467   accessing ``request.response`` (e.g. code which does
468   ``request.response_content_type = 'abc'`` should be changed to
469   ``request.response.content_type = 'abc'``).
470
471 - Passing view-related parameters to
472   ``pyramid.config.Configurator.add_route`` is now deprecated.  Previously, a
473   view was permitted to be connected to a route using a set of ``view*``
474   parameters passed to the ``add_route`` method of the Configurator.  This
475   was a shorthand which replaced the need to perform a subsequent call to
476   ``add_view``. For example, it was valid (and often recommended) to do::
477
478      config.add_route('home', '/', view='mypackage.views.myview',
479                        view_renderer='some/renderer.pt')
480
bf8c8f 481   Passing ``view*`` arguments to ``add_route`` is now deprecated in favor of
CM 482   connecting a view to a predefined route via ``Configurator.add_view`` using
483   the route's ``route_name`` parameter.  As a result, the above example
ed7ffe 484   should now be spelled::
CM 485
f426e5 486      config.add_route('home', '/')
CM 487      config.add_view('mypackage.views.myview', route_name='home')
488                      renderer='some/renderer.pt')
489
490   This deprecation was done to reduce confusion observed in IRC, as well as
491   to (eventually) reduce documentation burden (see also
492   https://github.com/Pylons/pyramid/issues/164).  A deprecation warning is
493   now issued when any view-related parameter is passed to
494   ``Configurator.add_route``.
495
496 - Passing an ``environ`` dictionary to the ``__call__`` method of a
497   "traverser" (e.g. an object that implements
498   ``pyramid.interfaces.ITraverser`` such as an instance of
499   ``pyramid.traversal.ResourceTreeTraverser``) as its ``request`` argument
500   now causes a deprecation warning to be emitted.  Consumer code should pass a
501   ``request`` object instead.  The fact that passing an environ dict is
502   permitted has been documentation-deprecated since ``repoze.bfg`` 1.1, and
503   this capability will be removed entirely in a future version.
504
505 - The following (undocumented, dictionary-like) methods of the
4d9260 506   ``pyramid.request.Request`` object have been deprecated: ``__contains__``,
CM 507   ``__delitem__``, ``__getitem__``, ``__iter__``, ``__setitem__``, ``get``,
508   ``has_key``, ``items``, ``iteritems``, ``itervalues``, ``keys``, ``pop``,
509   ``popitem``, ``setdefault``, ``update``, and ``values``.  Usage of any of
510   these methods will cause a deprecation warning to be emitted.  These
511   methods were added for internal compatibility in ``repoze.bfg`` 1.1 (code
512   that currently expects a request object expected an environ object in BFG
513   1.0 and before).  In a future version, these methods will be removed
514   entirely.
515
920990 516 - Deprecated ``pyramid.view.is_response`` function in favor of (newly-added)
CM 517   ``pyramid.request.Request.is_response`` method.  Determining if an object
518   is truly a valid response object now requires access to the registry, which
519   is only easily available as a request attribute.  The
520   ``pyramid.view.is_response`` function will still work until it is removed,
521   but now may return an incorrect answer under some (very uncommon)
522   circumstances.
523
4d9260 524 Behavior Changes
CM 525 ----------------
526
18b25a 527 - The default Mako renderer is now configured to escape all HTML in
MM 528   expression tags. This is intended to help prevent XSS attacks caused by
529   rendering unsanitized input from users. To revert this behavior in user's
530   templates, they need to filter the expression through the 'n' filter.
531   For example, ${ myhtml | n }.
532   See https://github.com/Pylons/pyramid/issues/193.
533
99edc5 534 - A custom request factory is now required to return a request object that
4d9260 535   has a ``response`` attribute (or "reified"/lazy property) if they the
CM 536   request is meant to be used in a view that uses a renderer.  This
537   ``response`` attribute should be an instance of the class
538   ``pyramid.response.Response``.
539
540 - The JSON and string renderer factories now assign to
541   ``request.response.content_type`` rather than
bf7544 542   ``request.response_content_type``.
CM 543
544 - Each built-in renderer factory now determines whether it should change the
545   content type of the response by comparing the response's content type
546   against the response's default content type; if the content type is the
547   default content type (usually ``text/html``), the renderer changes the
548   content type (to ``application/json`` or ``text/plain`` for JSON and string
549   renderers respectively).
4d9260 550
ba0a5f 551 - The ``pyramid.wsgi.wsgiapp2`` now uses a slightly different method of
CM 552   figuring out how to "fix" ``SCRIPT_NAME`` and ``PATH_INFO`` for the
553   downstream application.  As a result, those values may differ slightly from
554   the perspective of the downstream application (for example, ``SCRIPT_NAME``
555   will now never possess a trailing slash).
556
bca03f 557 - Previously, ``pyramid.request.Request`` inherited from
CM 558   ``webob.request.Request`` and implemented ``__getattr__``, ``__setattr__``
559   and ``__delattr__`` itself in order to overidde "adhoc attr" WebOb behavior
560   where attributes of the request are stored in the environ.  Now,
561   ``pyramid.request.Request`` object inherits from (the more recent)
562   ``webob.request.BaseRequest`` instead of ``webob.request.Request``, which
563   provides the same behavior.  ``pyramid.request.Request`` no longer
564   implements its own ``__getattr__``, ``__setattr__`` or ``__delattr__`` as a
565   result.
566
966b5c 567 - ``pyramid.response.Response`` is now a *subclass* of
99edc5 568   ``webob.response.Response`` (in order to directly implement the
CM 569   ``pyramid.interfaces.IResponse`` interface).
570
53d11e 571 - The "exception response" objects importable from ``pyramid.httpexceptions``
CM 572   (e.g. ``HTTPNotFound``) are no longer just import aliases for classes that
573   actually live in ``webob.exc``.  Instead, we've defined our own exception
574   classes within the module that mirror and emulate the ``webob.exc``
1e5e31 575   exception response objects almost entirely.  See the "Design Defense" doc
CM 576   section named "Pyramid Uses its Own HTTP Exception Classes" for more
577   information.
53d11e 578
d868ff 579 Backwards Incompatibilities
CM 580 ---------------------------
99edc5 581
5484e3 582 - Pyramid no longer supports Python 2.4.  Python 2.5 or better is required to
CM 583   run Pyramid 1.1+.
584
99edc5 585 - The Pyramid router now, by default, expects response objects returned from
d868ff 586   view callables to implement the ``pyramid.interfaces.IResponse`` interface.
CM 587   Unlike the Pyramid 1.0 version of this interface, objects which implement
588   IResponse now must define a ``__call__`` method that accepts ``environ``
589   and ``start_response``, and which returns an ``app_iter`` iterable, among
590   other things.  Previously, it was possible to return any object which had
591   the three WebOb ``app_iter``, ``headerlist``, and ``status`` attributes as
592   a response, so this is a backwards incompatibility.  It is possible to get
593   backwards compatibility back by registering an adapter to IResponse from
594   the type of object you're now returning from view callables.  See the
595   section in the Hooks chapter of the documentation entitled "Changing How
596   Pyramid Treats View Responses".
597
598 - The ``pyramid.interfaces.IResponse`` interface is now much more extensive.
599   Previously it defined only ``app_iter``, ``status`` and ``headerlist``; now
600   it is basically intended to directly mirror the ``webob.Response`` API,
601   which has many methods and attributes.
966b5c 602
d0a5f0 603 - The ``pyramid.httpexceptions`` classes named ``HTTPFound``,
CM 604   ``HTTPMultipleChoices``, ``HTTPMovedPermanently``, ``HTTPSeeOther``,
605   ``HTTPUseProxy``, and ``HTTPTemporaryRedirect`` now accept ``location`` as
606   their first positional argument rather than ``detail``.  This means that
607   you can do, e.g. ``return pyramid.httpexceptions.HTTPFound('http://foo')``
608   rather than ``return
609   pyramid.httpexceptions.HTTPFound(location='http//foo')`` (the latter will
610   of course continue to work).
611
0f7831 612 Dependencies
CM 613 ------------
614
dad904 615 - Pyramid now depends on WebOb >= 1.0.2 as tests depend on the bugfix in that
CM 616   release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``".
0f7831 617   (Note that in reality, everyone should probably be using 1.0.4 or better
CM 618   though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.)
619