[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-23 Thread Aviv Palivoda
Aviv Palivoda added the comment: I understand the problem and why this patch should be rejected. -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-22 Thread Martin Panter
Martin Panter added the comment: I suggest to reject this. Checking a flag before using a shared file descriptor is a recipe for a race condition, and in this case, unspecified behaviour: (applies to select and poll). --

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-20 Thread Aviv Palivoda
Aviv Palivoda added the comment: I see your point about the server_close purpose and I changed the patch to simulate the behavior of closed file (raising ValueError when operating on closed file). I don't think that this should be an enhancement as what i try to do is return the behavior as it

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-19 Thread Martin Panter
Martin Panter added the comment: I thought the purpose of server_close() was to clean up resources after you have finished calling serve_forever() or handle_request(). Just like you call close() on a file after you have finished reading or writing it. If you try to read or write a closed file,

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-19 Thread Aviv Palivoda
New submission from Aviv Palivoda: Currently if you call server_close you only close the socket. If we called serve_forever and then call server_close without calling shutdown the serve_forever loop keep running. Before using the selectors module for doing the poll we would have had exception