Whole file
ymattw/ydiff
The author described this change as “Fix issue #31 by catching UnicodeDecodeError as well”. It counts as a record because the check below fails on the code as it stood at e83642c79 and passes on 73e8e660b, with nothing else changed between the two runs.
Projectymattw/ydiff
Fix saved2013-09-10
Sharing licenceBSD-3-Clause · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
Fix issue #31 by catching UnicodeDecodeError as well
The change
| 634 | 634 | """Decode UTF-8 if necessary.""" | |
| 635 | 635 | try: | |
| 636 | 636 | return line.decode('utf-8') | |
| 637 | - | except AttributeError: | |
| 637 | + | except (AttributeError, UnicodeDecodeError): | |
| 638 | 638 | return line | |
| 639 | 639 | ||
| 640 | 640 |
The check that tells the two apart
fail→pass·tests/test_cdiff.py::DecodeTest::test_malformed_utf8
Check file tests/test_cdiff.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before ite83642c799b8c23bd563ec0c8aa33cc7c89fc154
Broken version dated2013-09-10
Modulecdiff
Units changeddecode
Fingerprint12f1daf30bab348a
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.