[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 54402b25f0b9 by Victor Stinner in branch '3.4': Issue #22564: ssl doc: fix typos https://hg.python.org/cpython/rev/54402b25f0b9 New changeset 61e52fda1006 by Victor Stinner in branch '3.4': Issue #22564: ssl doc: document read(), write(), pending,

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 61fbd3d5c307 by Victor Stinner in branch '3.4': Issue #22564: ssl doc: mention asyncio in the non-blocking section https://hg.python.org/cpython/rev/61fbd3d5c307 New changeset 11ad670ca663 by Victor Stinner in branch 'default': Issue #22564: ssl

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-10 Thread STINNER Victor
STINNER Victor added the comment: Ok, I think I addressed most of my remarks and I consider the issue as done. For total cleanness maybe the constructor should raise a TypeError if server_hostname is passes as a bytes. Please open a new issue to address this point. -- resolution:

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: Here is a first patch for SSL documentation. If the patch looks fine, I will first apply revelant parts to Python 3.4 documentation. -- keywords: +patch Added file: http://bugs.python.org/file36850/ssl_doc.patch ___

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-07 Thread STINNER Victor
STINNER Victor added the comment: For total cleanness maybe the constructor should raise a TypeError if server_hostname is passes as a bytes. Oh. So there are two attributes? SSLSocket.server_hostname and SSLSocket._sslobj.server_hostname? The constructor should make sure that both are

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread STINNER Victor
New submission from STINNER Victor: Hi, I just saw that the changeset a79003f25a41 was merged and it adds support for memory BIO to the Python ssl module, great! It's a nice addition, especially because it becomes possible to implement SSL for IOCP event loop in asyncio (#22560). I read the

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +geertj, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22564 ___ ___

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Geert Jansen
Geert Jansen added the comment: Hi Victor, see below my comments: * SSLSocket.read(), SSLOBject.read() and _ssl._SSLSocket.read() taking a buffer as the second positional argument. Both SSLSocket.read() and _SSLSocket.read() already accepted two arguments so I went for consistency. The

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Alex Gaynor
Changes by Alex Gaynor alex.gay...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22564 ___ ___ Python-bugs-list mailing

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: +.. attribute:: SSLSocket.server_hostname + + A ``bytes`` instance (...) Ah, this is a mistake. It's actually always a str instance (on SSLObject as well). -- ___ Python tracker rep...@bugs.python.org

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Geert Jansen
Geert Jansen added the comment: +.. attribute:: SSLSocket.server_hostname + + A ``bytes`` instance (...) Ah, this is a mistake. It's actually always a str instance (on SSLObject as well). It is indeed, I stand corrected. I was confused by the decode - encode roundtrip that happens in

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread STINNER Victor
STINNER Victor added the comment: However I think that in theory SSLSocket.server_hostname could be a bytes, if a bytes was passed into the constructor. newPySSLSocket() expects a char* string and use PyUnicode_Decode() to decode bytes. -- ___

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Geert Jansen
Geert Jansen added the comment: newPySSLSocket() expects a char* string and use PyUnicode_Decode() to decode bytes. Yup, and this value is available as SSLSocket._sslobj.server_hostname. But SSLSocket.server_hostname is not this, it is what was passed to the constructor which can be a