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 2011年05月12日 19:33 by r.david.murray, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| ssl_connect_ex.patch | pitrou, 2011年05月18日 16:27 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg135853 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年05月12日 19:33 | |
See http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%203.2/builds/34/steps/test/logs/stdio Antoine says that connect_ex should be returning an error, not None, in that situation. |
|||
| msg135855 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年05月12日 19:37 | |
Judging by ssl.connect_ex's source code, this can only mean that socket.connect raised a socket error with a "None" errno... |
|||
| msg135856 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年05月12日 19:41 | |
Which probably means it was a socket.timeout. When called on a non-SSL socket, connect_ex() returns 11 (EAGAIN) for timeout errors:
>>> s = socket.socket()
>>> s.settimeout(0.00001)
>>> s.connect_ex(("svn.python.org", 443))
11
But on SSL sockets, connect_ex() loses the errno (because it calls connect() on the underlying socket, not connect_ex(), and socket.timeout isn't raised with an errno):
>>> s = ssl.wrap_socket(socket.socket())
>>> s.settimeout(0.00001)
>>> print(s.connect_ex(("svn.python.org", 443)))
None
|
|||
| msg136251 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年05月18日 16:27 | |
Here is a patch. |
|||
| msg136254 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年05月18日 16:52 | |
New changeset 019d8ccdf03b by Antoine Pitrou in branch '3.2': Issue #12065: connect_ex() on an SSL socket now returns the original errno http://hg.python.org/cpython/rev/019d8ccdf03b New changeset 162ed9841f14 by Antoine Pitrou in branch 'default': Issue #12065: connect_ex() on an SSL socket now returns the original errno http://hg.python.org/cpython/rev/162ed9841f14 |
|||
| msg178408 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年12月28日 18:05 | |
New changeset 3436769a7964 by Antoine Pitrou in branch '2.7': Backport Python 3.2 fix for issue #12065, and add another test for SSLSocket.connect_ex(). http://hg.python.org/cpython/rev/3436769a7964 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:17 | admin | set | github: 56274 |
| 2012年12月28日 18:05:44 | python-dev | set | messages: + msg178408 |
| 2011年05月18日 16:53:36 | pitrou | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2011年05月18日 16:52:35 | python-dev | set | nosy:
+ python-dev messages: + msg136254 |
| 2011年05月18日 16:27:18 | pitrou | set | files:
+ ssl_connect_ex.patch keywords: + patch messages: + msg136251 stage: needs patch -> patch review |
| 2011年05月12日 19:41:13 | pitrou | set | messages: + msg135856 |
| 2011年05月12日 19:37:10 | pitrou | set | messages: + msg135855 |
| 2011年05月12日 19:33:39 | pitrou | set | nosy:
+ pitrou versions: + Python 3.3 |
| 2011年05月12日 19:33:12 | r.david.murray | create | |