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 2012年12月08日 19:35 by asvetlov, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg177174 - (view) | Author: Andrew Svetlov (asvetlov) * (Python committer) | Date: 2012年12月08日 19:35 | |
http://www.python.org/dev/peps/pep-3151 define exception classes like ConnectionError and BrokenPipeError We need to refactor stdlib to use that shiny new exceptions instead of checking errno values if possible. Also maybe we need to add some absent exceptions. I guess NotConnectedError for ENOTCONN, which should be ConnectionError subclass. |
|||
| msg177175 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2012年12月08日 19:44 | |
Right now I'm working on a patch. ;) A pack of issues were produced in process. |
|||
| msg177176 - (view) | Author: Andrew Svetlov (asvetlov) * (Python committer) | Date: 2012年12月08日 19:54 | |
Please, feel free to add me in nosylist for any issue related to this one. |
|||
| msg234295 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2015年01月18日 23:59 | |
I would support adding ENOTCONN under the ConnectionError umbrella. It is caught for shutdown() calls in a few standard library modules. Here is a demo showing how to trigger it (at least on Linux):
from socket import create_connection, SHUT_RDWR
from socketserver import TCPServer, BaseRequestHandler
from threading import Thread
server = TCPServer(("", 0), BaseRequestHandler)
Thread(target=server.serve_forever).start()
client = create_connection(server.server_address)
server.shutdown() # Ensure server has closed client connection
server.server_close()
client.send(bytes(1))
>>> client.shutdown(SHUT_RDWR)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 107] Transport endpoint is not connected
|
|||
| msg234550 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年01月23日 09:41 | |
Oh, I didn't know this issue. FYI I modified the subprocess module to use new specialized OSError exceptions: issue #23234 (changeset 0c5ae257966f). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:39 | admin | set | github: 60852 |
| 2018年01月29日 13:48:51 | asvetlov | set | status: open -> closed resolution: fixed stage: needs patch -> resolved |
| 2015年01月23日 10:56:04 | serhiy.storchaka | set | dependencies: + refactor subprocess: use new OSError exceptions, factorize stdin.write() code |
| 2015年01月23日 09:41:18 | vstinner | set | nosy:
+ vstinner messages: + msg234550 |
| 2015年01月18日 23:59:02 | martin.panter | set | nosy:
+ martin.panter messages: + msg234295 |
| 2012年12月18日 22:08:27 | serhiy.storchaka | set | dependencies: + Get rid of os.error. Use OSError instead |
| 2012年12月18日 21:33:41 | serhiy.storchaka | set | dependencies: + Get rid of WindowsError. Use OSError instead |
| 2012年12月18日 18:13:42 | serhiy.storchaka | set | dependencies: + Raise exceptions, don't throw |
| 2012年12月17日 20:31:54 | asvetlov | set | dependencies: + Use concrete classes inherited from OSError instead of errno check |
| 2012年12月17日 20:10:24 | asvetlov | set | dependencies: + Get rid of select.error in stdlib. Use OSError instead |
| 2012年12月15日 22:01:23 | serhiy.storchaka | set | dependencies: + Wrong code in ContextManagerTests.test_invalid_args() in test_subprocess.py, Wrong test_extract_hardlink() in test_tarfile.py, FTP.makeport() loses socket error details, LMTP.connect() loses socket error details, Popen._internal_poll() references errno.ECHILD outside of the local scope |
| 2012年12月08日 19:54:46 | asvetlov | set | messages: + msg177176 |
| 2012年12月08日 19:44:17 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg177175 |
| 2012年12月08日 19:35:47 | asvetlov | create | |