Fix crash on missing ripemd160 hash function; add troubleshooting guide #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a fallback handler in
lbry/crypto/hash.pyto gracefully handle environments where the'ripemd160'hash is not supported by OpenSSL. The fallback prevents a startup crash and prints a helpful error message.Additionally, a note has been added to the
README.mdto help users resolve the issue if it occurs, particularly in WSL or custom Python builds.Changes
hashlib.new('ripemd160')in a try/except blockREADME.mdReason
Without this fix,
lbrynetcrashes at startup with a crypticValueError: unsupported hash type ripemd160in certain environments (e.g., WSL2 with some OpenSSL builds). This addresses that critical error while documenting a workaround.Related
✅ Happy to iterate if improvements are suggested.