This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jborgstrom
Recipients jborgstrom
Date 2013-06-17.10:38:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za>
In-reply-to
Content
Problem:
In hmac.py there's a type check that verifies that the msg parameter is of type bytes().

if not isinstance(msg, bytes):
    raise TypeError("expected bytes, but got %r" % type(msg).__name__)

That is incorrect. The hmac module should also work with other data types as long as they are supported by the underlying hashlib module, for example bytearray() and memoryview().

Suggestion:
Remove that type check. hashlib will make sure str() and other invalid data types raises a TypeError.
History
Date User Action Args
2013-06-17 10:38:28jborgstromsetrecipients: + jborgstrom
2013-06-17 10:38:28jborgstromsetmessageid: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za>
2013-06-17 10:38:28jborgstromlinkissue18240 messages
2013-06-17 10:38:28jborgstromcreate