New submission from Martin Panter:
SystemError indicates an internal error that is not supposed to be triggerable
from Python code. We should probably raise ValueError like plain sockets
instead.
>>> s = create_connection(("python.org", 443))
>>> s.recv(-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: negative buffersize in recv
>>> ss = ssl.wrap_socket(s)
>>> ss.recv(-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/proj/python/cpython/Lib/ssl.py", line 910, in recv
return self.read(buflen)
File "/home/proj/python/cpython/Lib/ssl.py", line 787, in read
return self._sslobj.read(len, buffer)
File "/home/proj/python/cpython/Lib/ssl.py", line 573, in read
v = self._sslobj.read(len or 1024)
SystemError: Negative size passed to PyBytes_FromStringAndSize
----------
components: Extension Modules
messages: 262488
nosy: martin.panter
priority: normal
severity: normal
status: open
title: SSLSocket.recv(-1) triggers SystemError
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26644>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com