[reportlab-users] Use of hashlib.md5
Robin Becker
robin at reportlab.com
Fri Sep 19 05:07:17 EDT 2025
Hi Cristoph,
this new argument was added explicitly to allow use of reportlab in FIPS environments. The usedforsecurity argument
appears to be allowed in all latest live pythons as it was introduced in python 3.9.
Python 3.8 became EOL in 2024 (end of life) and it's recommended to upgrade.
Python 3.9 will become EOL soon and we will eventually drop support for it.
Hope this is not too inconvenient
--
Robin Becker
On 18/09/2025 19:15, Christoph Zwerschke wrote:
> Recently I got this error on a Linux Box
>
> File ".../reportlab/pdfbase/pdfdoc.py", line 137, in __init__
> sig = self.signature = md5(usedforsecurity=False)
> TypeError: openssl_md5() takes no keyword arguments
>
> This kind of error can be avoided if you use hashlib.new('md5', ...) instead of hashlib.md5(...). There are 3 or 4 more
> such places in the code where this should be changed.
>
> see https://stackoverflow.com/questions/54717862/how-do-i-know-if-the-usedforsecurity-flag-is-supported-by-hashlib-md5
>
> I can confirm that it works for me after making this change.
>
> -- Christoph
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> https://pairlist2.pair.net/mailman/listinfo/reportlab-users
More information about the reportlab-users
mailing list