substituted formatwarning is old, signature in python2.6 is changed
This problem turned out to be that cherrypy, when running as a daemon, invokes code in _cpchecker.py which replaces warnings.formatwarning !!!!!!!
And the replacement isn't up to date with the latest changes in 2.6 and 3.0, which is to have an additional, optional, line=None parameter at the end of the formatwarning parameter list.
I don't know if this means that cherrypy is clever, too clever, or not clever enough, but I do know that it means it is broken. Adding the extra parameter to the replacement function cures the problem, but it is not clear to me if the substitution is the appropriate style of coding or not, but that sort of code is prone to breakage.