You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
async_replicate: replace integrity asserts with explicit raises (don't rely on Python without -O) #70
The replicator (simpler_objects/async_replicate.py) uses assert for what are really integrity checks: that the source has a content-length and a Repr-Digest, that the destination is missing before we PUT, that the stream's length and digest match what we expected, and that the destination holds the right bytes after the PUT.
Under python -O (or PYTHONOPTIMIZE=1) every one of those becomes a no-op. When the replicator was a manual CLI invocation that was a footgun; now that it runs on every systemd-timer / cron firing under whatever Python the operator installed, it's worth fixing.
Suggested approach: replace the asserts in replicate_object, auto_replica, and replicate_bucket with explicit if not …: raise <appropriate error>. The places that currently assert on httpx response shape can stay defensive — they just shouldn't disappear under -O.
Activity