Use of hashlib.md5

Christoph Zwerschke <[email protected]> Thu, 18 Sep 2025 20:15:33 +0200
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
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