dabeaz / curio

Good Curio!
Other
4.02k stars 241 forks source link

Follow SSL Server example then crash #183

Closed berryfl closed 7 years ago

berryfl commented 7 years ago

OS: Debian 8 Python: 3.6.0

When I follow the ssl server example in tutorial, the script crash with the following stack trace:

Curio: Task Crash: tcp_server Traceback (most recent call last): File "/home/berry/curioenv/lib/python3.6/site-packages/curio/kernel.py", line 950, in _run_coro trap = current._send(current.next_value) File "/home/berry/curioenv/lib/python3.6/site-packages/curio/network.py", line 134, in tcp_server await _run_server(sock, client_connected_task, ssl) File "/home/berry/curioenv/lib/python3.6/site-packages/curio/network.py", line 108, in _run_server client = ssl.wrap_socket(client._socket, server_side=True, do_handshake_on_connect=False) File "/home/berry/curioenv/lib/python3.6/site-packages/curio/ssl.py", line 50, in wrap_socket sock._socket, *args, do_handshake_on_connect=False, **kwargs) AttributeError: 'socket' object has no attribute '_socket'

I edit curio/ssl.py, then replace sock._socket with sock seems work.

dabeaz commented 7 years ago

Bizarre. Have pushed a fix. Will work on some better test coverage for this.