{"id":24506,"library":"rdiff","title":"rdiff","description":"A native Python implementation of the rdiff tool by librsync, providing signature, delta, and patch operations for file synchronization. Current version 0.2.3, requires Python >=3.6. Maintained irregularly; last release in 2022.","status":"active","version":"0.2.3","language":"python","source_language":"en","source_url":"https://github.com/MohitPanchariya/rdiff","tags":["rdiff","librsync","delta","patch"],"install":[{"cmd":"pip install rdiff","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"signature","correct":"from rdiff import signature"},{"note":"","wrong":"","symbol":"delta","correct":"from rdiff import delta"},{"note":"","wrong":"","symbol":"patch","correct":"from rdiff import patch"}],"quickstart":{"code":"from rdiff import signature, delta, patch\n\n# Create signature from original file\nsig = signature(b'original data')\n\n# Compute delta between signature and new file\nd = delta(sig, b'new data with changes')\n\n# Apply delta to original data to get new data\nnew_data = b'original data'\npatched = patch(new_data, d)\nprint(patched)","lang":"python","description":"Basic usage of rdiff: signature on original data, delta on new data, and patch to reconstruct the new file."},"warnings":[{"fix":"No fix needed; this is internal but may affect performance.","message":"rdiff uses a custom MD4 implementation which may be slower or less tested than standard hashlib. It was introduced in v0.2.0 because hashlib's md4 is not guaranteed to be available on all platforms.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Evaluate if rdiff meets your needs or switch to librsync bindings (e.g., pylibrsync).","message":"The rdiff library has not been updated since 2022. Be aware that it may not support newer Python versions or receive bug fixes. Consider using librsync or other alternatives for production use.","severity":"deprecated","affected_versions":"all"},{"fix":"Always encode strings to bytes before calling signature, delta, or patch: e.g., b'data' or data.encode('utf-8').","message":"The signature function expects bytes, not str. Passing a string will raise a TypeError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use bytes literals (b'...') or encode your strings: data.encode('utf-8').","cause":"Passing a string instead of bytes to signature(), delta(), or patch().","error":"TypeError: a bytes-like object is required, not 'str'"},{"fix":"Ensure you installed rdiff (not rdiff-backup or other packages) and use `from rdiff import signature`.","cause":"Outdated version or incorrect import (e.g., installed wrong package or import path).","error":"AttributeError: module 'rdiff' has no attribute 'signature'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}