Antoine Pitrou <pit...@free.fr> added the comment:

> If now I can get a "retry" while writing, what is the logic?. Does
> Python retry automatically, internally?.

No, Python doesn't retry automatically. You have to call send() again with the 
same buffer.
(if Python retried, it would make non-blocking calls blocking)

Also, the args[0] of the SSL error tells you what the SSL layer is blocking on 
(SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE). 

Also, with the current setup, non-blocking write() will never succeed with a 
partial write. See issue12197.
(that doesn't mean nothing is written on the network, though. OpenSSL may start 
emitting bytes and keep track internally of what remains to be sent. The 
OpenSSL documentation isn't very clear on that, IIRC)

> I think SSL module documentation should write down this captchas when 
> using non-blocking sockets. That is, that read/write can raise
> exceptions even if "select" was OK.

Agreed.

Relatedly, there's issue10084 for SSL support in asyncore.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12343>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to