[docs] http://docs.python.org/2/library/hashlib.html

Andrew Svetlov andrew.svetlov at gmail.com
Tue Nov 27 18:41:44 CET 2012


The doc is correct.
For python2 `.update` method of hash objects accept str.
Python3 requires bytes, doc changed to something like

>>> import hashlib
>>> m = hashlib.md5()
>>> m.update(b"Nobody inspects")

On Thu, Nov 8, 2012 at 2:57 PM, Hugh Parker <hcp at pobox.com> wrote:
> http://docs.python.org/2/library/hashlib.html has an error:
>
> m.update("Blah") doesn't work.  It gives a type error.  To work, it needs to
> be m.update("Blah".encode('utf-8'))
>
> I'm using Python 3.3.
>
> _______________________________________________
> docs mailing list
> docs at python.org
> http://mail.python.org/mailman/listinfo/docs
>



--
Thanks,
Andrew Svetlov


More information about the docs mailing list