This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年09月16日 09:26 by Алексей Смирнов, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Repositories containing patches | |||
|---|---|---|---|
| https://hg.python.org/cpython/file/tip/Lib/socketserver.py#l627 | |||
| Messages (4) | |||
|---|---|---|---|
| msg250833 - (view) | Author: Алексей Смирнов (Алексей Смирнов) | Date: 2015年09月16日 09:26 | |
https://github.com/python/cpython/blob/3.5/Lib/socketserver.py#L627 Must be: try: self.finish_request(request, client_address) except: self.handle_error(request, client_address) finally: self.shutdown_request(request) |
|||
| msg251042 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2015年09月18日 23:35 | |
I believe this is equivalent. In general, bare excepts should be either made more specific or commented as intentional. Since derived classes can override finish_request, and fail any which way, the latter is probably appropriate here: # derived classes may override finish_request |
|||
| msg251058 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2015年09月19日 06:47 | |
I suggest changing the "except" clause to "except BaseException", which would make the intention clearer. As an alternative, see also my Issue 23430, were I proposed not catching exceptions like KeyboardInterrupt and SystemExit, by changing this to: try: self.finish_request(request, client_address) except Exception: self.handle_error(request, client_address) finally: self.shutdown_request(request) |
|||
| msg260608 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2016年02月21日 11:25 | |
I pushed the above code to 3.6, so closing this. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:21 | admin | set | github: 69326 |
| 2016年02月21日 11:25:51 | martin.panter | set | status: open -> closed superseder: socketserver.BaseServer.handle_error() should not catch exiting exceptions messages: + msg260608 resolution: out of date stage: patch review -> resolved |
| 2015年09月19日 06:47:13 | martin.panter | set | nosy:
+ martin.panter messages: + msg251058 title: Just a little refactoring -> socketserver.ThreadingMixIn exception handler: Just a little refactoring |
| 2015年09月18日 23:35:44 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg251042 |
| 2015年09月16日 17:58:31 | berker.peksag | set | nosy:
+ berker.peksag |
| 2015年09月16日 17:57:35 | berker.peksag | set | stage: patch review versions: + Python 3.6, - Python 3.5 |
| 2015年09月16日 09:26:03 | Алексей Смирнов | create | |