* Fix md5_hexdigest wrapper on FIPS enabled systems
* Update _compat.py
* lint
# See issue: https://github.com/encode/starlette/issues/1365
try:
- hashlib.md5(b"data", usedforsecurity=True) # type: ignore[call-arg]
+ # check if the Python version supports the parameter
+ # using usedforsecurity=False to avoid an exception on FIPS systems
+ # that reject usedforsecurity=True
+ hashlib.md5(b"data", usedforsecurity=False) # type: ignore[call-arg]
def md5_hexdigest(
data: bytes, *, usedforsecurity: bool = True