Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The cherrypy.engine can't handle DummyThreads on Python 3.4 #1342
I'm making a plugin to integrate Winpdb to CherryPy and I was having an issue with threads half-stopped on the
In particular this method sets the property:
And indeed is true, but the
This is an example of the resulting traceback:
I suggest that we can change the
And set it before the
This is valid from python 2.4 up to 3.4.
I can make this change, but I'm looking on a second opinion on this issue.
I have come across the same kind of problem, but have a different solution.
I am using Windows 7 x64 with Python 3.5.1, Cherrypy 4.0.0. The same issue will occur whether cherrypy is run from the console and inside of a service.
In a clean virtualenv, the problem does not appear until pywin32 is installed. It happens with both the Pypi "pypiwin32-219" wheel, and the "pywin32-220" wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs.
Steps to reproduce:
These are the commands to set it up, if your Windows is rusty.
If it doesn't happen the first time, start the server then try kicking off some threads by opening a browser and hitting 127.0.0.1:8080 a few times.
The problem goes away if the t.isAlive() check mentioned in the Traceback is removed, as follows:
This check to see if the thread is alive is not needed anyway, since from Python 2.6 to 3.5 , , the docs note that "The module function enumerate() returns a list of all alive threads". The objects being evaluated are from the enumerate call on line 325.
After making this change, the same sequence of steps results in successful shutdown, with the final log message "ENGINE Bus EXITED".