Commits

Anonymous committed e15c4fb

Changed page WhatsNewIn32

Comments (0)

Files changed (1)

WhatsNewIn32.wiki

+[This document is up-to-date as of [2061].
+
 = What's new in CherryPy 3.2 =
 
 This document only describes new features in CherryPy 3.2. A detailed "How To Upgrade" document is at [wiki:UpgradeTo32 UpgradeTo32].
+
+== Python 3 Support ==
+
+!CherryPy 3.2 runs on Python 3! You'll find separate downloadable packages, as well as a separate Subversion branch.
+
+== Improvements to cherryd ==
+
+The FastCGI support in `cherryd` is much improved and tested, including socket file support; also, autoreload and the conflicting signal handlers are now off by default. SCGI support is also included via the `-s` option to `cherryd` (thanks georgem).
+
+`cherryd` now also adds the current directory to sys.path, so that modules in it can be more easily imported.
+
+== wsgiserver Improvements ==
+
+Open sockets are no longer inherited by child processes (thanks nicolas grilly). See #856 for more details.
+
+== Dynamic Dispatch by Controllers ==
+
+To find a handler for the current request, !CherryPy's default dispatcher traverses a tree of objects and methods. Beginning in CherryPy 3.2, when a controller possesses a `_cp_dispatch(vpath)` method, !CherryPy's default dispatcher will now use its return value as the 'next hop' in the object traversal. Returning `None` effectively stops traversal; !CherryPy will then work backward looking for a default handler as normal. In addition, the `_cp_dispatch` method is a list of remaining path segments, and the method is allowed to mutate it. For example, to handle the URI `/users/123/profile`, a `Users._cp_dispatch` method would receive a `vpath` argument of `['123', 'profile']`, at which point it could write:
+
+{{{
+#!python
+def _cp_dispatch(vpath):
+    if vpath:
+        cherrypy.request.params['user_id'] = vpath.pop(0)
+    if vpath:
+        return getattr(self, vpath[0], None)
+}}}
+
+== Mismatched Request Params ==
+
+In previous versions, unexpected URI path segments, or unexpected parameters in the query string or request body, would generally return somewhat unhelpful "500 Server Error" responses. Starting in CherryPy 3.2, when query parameters passed to a handler are incorrect, or when path segments are incorrectly passed to a handler, "404 Not Found" is returned instead. When body params are incorrectly passed to a handler, "400 Bad Request" is returned.
+
+== Engine/Bus Improvements ==
+
+`cherrypy.engine` is an instance of `cherrypy.process.wspbus.Bus`.
+
+Beginning in !CherryPy 3.2, the "state" argument to `Bus.wait(state, interval)` may be a list or tuple, instead of a single state, in order to wake up on any of several states.
+
+All engine attributes may now be changed in config via the "engine.*" config namespace.
+
+Engine plugins, whether builtin or custom, may also now be configured if they are added to the engine object itself. The builtin plugins "autoreload", "thread_manager", "signal_handler", "timeout_monitor", and "console_control_handler" are already added. The "on" config entry subscribes or unsubscribes the plugin, and all other entries are set as attributes on the plugin instance.
+
+{{{
+#!python
+cherrypy.engine.my_plugin = MyPlugin(a=3, b='foo')
+...
+cherrypy.config.update({'engine.my_plugin.on': True,
+                        'engine.my_plugin.a': 16})
+}}}
+
+== Tool Improvements ==
+
+=== Sessions ===
+
+The session cleanup thread can be completely disabled now by setting `tools.sessions.clean_freq` to 0 or None. This is required for Google App Engine, which does not allow the creation of new threads.