Bug description:
According to its docstring, the function hashlib.shake_128(...).hexdigest() should accept an argument length, either as positional or as keyword argument. However, since Python 3.14, the function only accepts positional arguments and fails with TypeError: shake_128.hexdigest() takes no keyword arguments otherwise.
I narrowed the root cause for this behaviour down to the following two commits (I'm not 100% sure though as I don't have any C-background):
Reproducer:
import hashlib
hashlib.shake_128(b'').hexdigest(1) # working
hashlib.shake_128(b'').hexdigest(length=1) # not working anymore, but was working before
For example, on Python Python 3.13.3 (main, Apr 8 2025, 13:54:08) [Clang 17.0.0 (clang-1700.0.13.3)] on my mac I can still use the keyword argument, but on alpine:edge Python 3.12.10 (main, May 21 2025, 16:23:36) [GCC 14.2.0] on linux it is expecting positional arguments only.
CPython versions tested on:
CPython main branch, 3.14, 3.13, 3.12
Operating systems tested on:
Linux, macOS
Linked PRs
Bug description:
According to its docstring, the function
hashlib.shake_128(...).hexdigest()should accept an argumentlength, either as positional or as keyword argument. However, since Python3.14, the function only accepts positional arguments and fails withTypeError: shake_128.hexdigest() takes no keyword argumentsotherwise.I narrowed the root cause for this behaviour down to the following two commits (I'm not 100% sure though as I don't have any C-background):
Reproducer:
For example, on Python
Python 3.13.3 (main, Apr 8 2025, 13:54:08) [Clang 17.0.0 (clang-1700.0.13.3)]on my mac I can still use the keyword argument, but onalpine:edgePython 3.12.10 (main, May 21 2025, 16:23:36) [GCC 14.2.0] on linuxit is expecting positional arguments only.CPython versions tested on:
CPython main branch, 3.14, 3.13, 3.12
Operating systems tested on:
Linux, macOS
Linked PRs
hashlibFIPS-only BLAKE-2 buildbot #134968