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.

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

246246 text.append("(enum) (unknown) %s" % (v, ))
247247 elif v.__class__.__name__ == "EnumIntegerString":
248248 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")))
249251 elif isinstance(v, bytestringtype):
250252 printingcap = 16
251253 if len(v) <= printingcap or globalPrintFullStrings:

The check that tells the two apart

failpass·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