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.

Author nemunaire
Recipients nemunaire
Date 2016-07-26.23:21:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I got this stacktrace:
  File "", line 3, in <module>
    sock = ssl.SSLSocket(server_hostname="")
  File "/usr/lib/python3.4/", line 536, in __init__
    if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM:
AttributeError: 'NoneType' object has no attribute 'getsockopt'

with this minimal code:
import ssl

sock = ssl.SSLSocket(server_hostname="")
sock.connect(("", 443))
sock.sendall(b"GET /3/library/ssl.html HTTP/1.0\r\nHost:\r\n\r\n")

Whereas the None socket is correctly handled a few lines later:

All Python >= 3.3 are affected (since and can be patched with the same file, attached to this issue.
Date User Action Args
2016-07-26 23:21:45nemunairesetrecipients: + nemunaire
2016-07-26 23:21:45nemunairesetmessageid: <>
2016-07-26 23:21:45nemunairelinkissue27629 messages
2016-07-26 23:21:45nemunairecreate