The diff_lines measure fails to compute when the diff output is without valid encoding. We should likely coerce the captured output to be handed as a binary string, with force_encoding('BINARY'). Counting "lines" in a binary diff is obviously a bit moot, though...