Vajrasky Kok added the comment:

This is the current behaviour of sha1 constructor. It rejects None value.

>>> import _sha1
>>> _sha1.sha1()
<_sha1.sha1 object at 0x7f7fa7f0dea0>
>>> _sha1.sha1(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object supporting the buffer API required
>>> _sha1.sha1(string=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object supporting the buffer API required

Then when I clinic it, what about the doc? This doesn't seem right.

+PyDoc_STRVAR(_sha1_SHA1_sha1__doc__,
+"sha1(string=None)\n"
 "Return a new SHA1 hash object; optionally initialized with a string.");

----------

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

Reply via email to