Issue #891 resolved

substituted formatwarning is old, signature in python2.6 is changed

guest
created an issue

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.

Comments (4)

  1. guest reporter

    See also Python issue 4891 (amazing, the numerical coincidence here, 891 vs 4891).

    It was suggested that the change to the warnings.formatwarning issue could be considered a bug in Python 2.6/3.0 rather than CherryPy. On the other hand, if they don't fix it, it should be fixed in CherryPy. And, maybe even if they do, it should also be fixed in CherryPy... in a version-specific manner.

  2. Log in to comment