This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients approximately, gregory.p.smith, pitrou, rhettinger, vstinner
Date 2014-07-01.17:29:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1404235788.45.0.249046812115.issue11771@psf.upfronthosting.co.za>
In-reply-to
Content
Please be constructive.

There is no way to implement generic pickling for hash objects that would work across all implementations.  

The underlying code implementing each function is free to store its internal state however it wants and does not provide an API to get at it or any standard representation of it.

Sure, you could hack things up and allow a specific version and build of openssl's EVP hashes to dump their state and restore it for use in another process running that same specific version and build of openssl (as would likely be the case for multiprocessing use) just as you could for any other implementation of a hash function such as the builtin libtomcrypt versions.  But this is not portable between compilations using different implementations of the hash algorithm.  That is not what someone using pickle would ever expect.

Public APIs to access the internal state of hash functions do not exist because it is not a common thing for people to do.

hashlib isn't going to support this unless someone contributes a very solid patch with tests that handles all of the compatibility issues in a friendly maintainable manner.
History
Date User Action Args
2014-07-01 17:29:48gregory.p.smithsetrecipients: + gregory.p.smith, rhettinger, pitrou, vstinner, approximately
2014-07-01 17:29:48gregory.p.smithsetmessageid: <1404235788.45.0.249046812115.issue11771@psf.upfronthosting.co.za>
2014-07-01 17:29:48gregory.p.smithlinkissue11771 messages
2014-07-01 17:29:48gregory.p.smithcreate