Stopping a wsgiref server programmatically

Gilles Lenfant gilles.lenfant at gmail.com
Tue Jan 14 06:21:03 EST 2014


Hi,

I made a small / minimal wsgiref HTTP server dedicated to unittest stubs (testing custom REST client and other likes) that works pretty good in a separate thread.

https://gist.github.com/glenfant/7369894

Feel free to reuse it in your own unittest stubs/mocks.

But it only works like a charm in an Unix box, due to the use of a control pipe ( https://gist.github.com/glenfant/7369894#file-pipetestserver-py-L118 ) that's checked with select.select ( https://gist.github.com/glenfant/7369894#file-pipetestserver-py-L133 ) and can be stopped on request when writing in that pipe ( https://gist.github.com/glenfant/7369894#file-pipetestserver-py-L173 ).

Is there a volunteer with a Windows box for helping me to get it fixed. Note: I have no windows box to experiment alternate.

Many thanks by advance.
-- 
Gilles Lenfant



More information about the Python-list mailing list