Bug report
Bug description:
hmac.digest() reaches key.ljust() with a key type its own class rejects by name, so hmac.digest(memoryview(key), msg, "md5") raises AttributeError instead of TypeError as hmac.HMAC does. I'm aligning the exceptions here but I may consider accepting other types later.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
hmac.digest()reacheskey.ljust()with a key type its own class rejects by name, sohmac.digest(memoryview(key), msg, "md5")raisesAttributeErrorinstead ofTypeErrorashmac.HMACdoes. I'm aligning the exceptions here but I may consider accepting other types later.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
hmac.digest#155427