Whole file
construct/construct
The author described this change as “Fix issue #709: Hex() might not always work.”. It counts as a record because the check below fails on the code as it stood at c30c74aff and passes on 32137b4de, with nothing else changed between the two runs.
Projectconstruct/construct
Fix saved2018-05-05
Sharing licenceMIT · LICENSE
Change size+2 −0
What the code was meant to do, written into the code itself as a save note
Fix issue #709: Hex() might not always work.
The change
| 246 | 246 | text.append("(enum) (unknown) %s" % (v, )) | |
| 247 | 247 | elif v.__class__.__name__ == "EnumIntegerString": | |
| 248 | 248 | text.append("(enum) %s %s" % (v, v.intvalue, )) | |
| 249 | + | elif v.__class__.__name__ in ["HexDisplayedBytes", "HexDumpDisplayedBytes"]: | |
| 250 | + | text.append(indentation.join(str(v).split("\n"))) | |
| 249 | 251 | elif isinstance(v, bytestringtype): | |
| 250 | 252 | printingcap = 16 | |
| 251 | 253 | if len(v) <= printingcap or globalPrintFullStrings: |
The check that tells the two apart
fail→pass·tests/test_core.py::test_hex_issue_709
Check file tests/test_core.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 itc30c74aff532b068d3449b5f18ab7fd104a54fa4
Broken version dated2018-04-09
Moduleconstruct.lib.containers
Units changedContainer
Fingerprint42f32ca6e605e345
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in construct/construct
- 2022-09-18Lazy
- 2018-04-02VarInt
- 2018-03-03TransformData
- 2017-10-08FIX: Left-shift operator (#406)
- 2017-08-29Switch
- 2017-06-01RawCopy