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 }}
This repository was archived by the owner on Oct 12, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 12, 2026. It is now read-only.
test_get_object_torrent: treat torrent body as bytes (not UTF-8) #725
In s3tests/functional/test_s3.py, test_get_object_torrent() calls _get_body(response) which unconditionally does got.decode() when the body is bytes.
A .torrent file is a bencoded binary format. The pieces field contains raw SHA1 digests, so the response body is not guaranteed to be valid UTF-8. When a backend returns an actual torrent body, the test can fail with UnicodeDecodeError even though the server is correct.
Suggested fix: in test_get_object_torrent, read response["Body"].read() as bytes and compare against data.encode("utf-8") (do not decode).
PR prepared on fork: drey123/s3-tests (branch omni-fix-torrent-bytes).
Activity