[issue13749] socketserver can't stop

2016-02-10 Thread Martin Panter
Martin Panter added the comment: For stopping a single-threaded server from a request handler, perhaps see my patch for Issue 23430, which should allow calling sys.exit() or raising exceptions like SystemExit that do not inherit Exception. It seems to me that shutdown() can only sensibly be

[issue13749] socketserver can't stop

2012-04-06 Thread Daniel Swanson
Daniel Swanson popcorn.tomato.d...@gmail.com added the comment: what about this? def __init__(...): ... self.stop = False while True: (do stuff) if self.stop: break def quit(or whatever it's called): self.stop = True That would work without the backwards copatability

[issue13749] socketserver can't stop

2012-04-06 Thread Daniel Swanson
Daniel Swanson popcorn.tomato.d...@gmail.com added the comment: Or even better: def __init__(...): ... self.stop = False while not self.stop: (do stuff) def quit(or whatever it's called): self.stop = True -- ___ Python tracker

[issue13749] socketserver can't stop

2012-04-06 Thread Daniel Swanson
Daniel Swanson popcorn.tomato.d...@gmail.com added the comment: I tryed to fix the problem, here is my attemt. -- Added file: http://bugs.python.org/file25148/tryfixsocketserver.py ___ Python tracker rep...@bugs.python.org

[issue13749] socketserver can't stop

2012-03-29 Thread Daniel Swanson
Daniel Swanson popcorn.tomato.d...@gmail.com added the comment: What about os._exit? or CTR-ALT-DEL (windows only) I'd say that socketserver.serveforever is very well named (Hey, if you can't turn it off then it's serving forever) -- nosy: +weirdink13

[issue13749] socketserver can't stop

2012-03-29 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: At the very least the docs should be clarified to say that you have to call shutdown from a separate thread. (The one example of using it does do that.) I don't have a strong opinion about the proposed new method, not having used

[issue13749] socketserver can't stop

2012-03-27 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13749 ___ ___

[issue13749] socketserver can't stop

2012-01-13 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- stage: - test needed versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13749 ___

[issue13749] socketserver can't stop

2012-01-09 Thread K Richard Pixley
New submission from K Richard Pixley r...@noir.com: Once I've instantiated my server class, along with a handler class, called server.serve_forever(), handler.handle() has been called, I've done my work, and I'm ready to shut the whole thing down... How do I do that? The doc says

[issue13749] socketserver can't stop

2012-01-09 Thread K Richard Pixley
K Richard Pixley r...@noir.com added the comment: It appears as though the problem is that shutdown() blocks waiting for the serve_forever loop to terminate, which won't happen as long as the process is blocked on shutdown. I'd like to propose that the library be changed to eliminate the

[issue13749] socketserver can't stop

2012-01-09 Thread K Richard Pixley
K Richard Pixley r...@noir.com added the comment: On second thought, my proposal is likely to break existing code, so I withdraw it. I don't know how to exit the server in a way that both works in all conditions and also continues to support existing semantics. I expect we'll need to create