Issue #1333 open

cpstats tool broken (python3.4)

Anonymous created an issue

I recently switched a project from Python 2.7 to 3.4. Everything seems to be working well with CherryPy, but the cpstats tool is failing when you try to load the stats page.

The following is the error as printed to the error console:

Traceback (most recent call last):
  File "/home/escher/lib/python3.4/cherrypy/", line 234, in __init__
  File "/home/escher/lib/python3.4/cherrypy/", line 337, in run, path, qs, rproto, headers, rfile)
  File "/home/escher/lib/python3.4/cherrypy/", line 589, in run
    self.respond( pi )
  File "/home/escher/lib/python3.4/cherrypy/", line 647, in respond
    self.namespaces( self.config )
  File "/home/escher/lib/python3.4/cherrypy/lib/", line 117, in __call__
    exit(None, None, None)
  File "/home/escher/lib/python3.4/cherrypy/", line 466, in __exit__
  File "/home/escher/lib/python3.4/cherrypy/lib/", line 312, in _setup
  File "/home/escher/lib/python3.4/cherrypy/lib/", line 334, in record_start
    'Start Time': time.time(),
AttributeError: 'module' object has no attribute '_get_ident'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/escher/lib/python3.4/cherrypy/", line 144, in release_serving
  File "/home/escher/lib/python3.4/cherrypy/", line 506, in close 'on_end_request' )
  File "/home/escher/lib/python3.4/cherrypy/", line 114, in run
    raise exc
  File "/home/escher/lib/python3.4/cherrypy/", line 104, in run
  File "/home/escher/lib/python3.4/cherrypy/", line 63, in __call__
    return self.callback( **self.kwargs )
  File "/home/escher/lib/python3.4/cherrypy/lib/", line 342, in record_stop
    w = appstats['Requests'][threading._get_ident()]
AttributeError: 'module' object has no attribute '_get_ident'

Comments (3)

  1. Joel Rivera
    • changed status to open

    This is correct, there are a couple if changes on the threading module for 3.4.

    In particular this is a trivial fix, we just need to drop the _ the new name is: threading.get_ident.

    But for compatibility reasons this will probably require an addition to the _cpcompat module.

  2. Log in to comment