step-examples/12-13-writer-pathology/Wr001.stp
Sources
- prostep ivip CAx-IF round-trip reports
- FreeCAD #4231 "STEP exporter pads lines with spaces"
- bug-reporter language: "diff between exports is all whitespace"
Sender
Older FreeCAD STEP writer (pre-0.20) and some Pro/E export filters
Description
Every record line in the DATA section ends with one or more ASCII space (0x20) characters before the line terminator. Spec-conforming parsers accept this (whitespace is insignificant outside string literals), but downstream tools that diff exports for change-detection see noise on every line, version-control systems show every line as modified on every export, and crude line-based regex parsers that anchor on `;$` mis-match. Bug-reporter language: "STEP file has trailing spaces", "every line ends with whitespace", "diff is huge but nothing changed", "git keeps marking the file dirty".
Reproducer recipe
minimal Part-21 file where each `#NNN=ENTITY(..);` line ends with ` ` (three spaces) before `\n`.
Expected kernel behavior
read tolerantly; the spec permits insignificant whitespace anywhere outside string literals. Optionally normalise on re-emit. A downstream tool that warns on this is over-strict; a producer that emits this is sloppy but not malformed.
Notes
Practically harmless to parse; the cost is to humans who diff exports. Provenance tier: writer-side (Q5 reclassification 2026-07-01).
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Provenance tier
writer-side — defect not fully embodied in fixture bytes.
Byte assertions
matches(rb' +\n')count(b' \n') >= 5
Tier-3 assertions
load == "ok"
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Wr001: trailing whitespace on every record line */ 3HEADER; 4FILE_DESCRIPTION(('Wr001 - trailing whitespace on every data line'),'2;1'); 5FILE_NAME('Wr001.stp','2026-06-20T00:00:00',('auto-generated'),(''), 6 'auto-generated','',''); 7FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 8ENDSEC; 9DATA; 10/* Defect: every entity line ends with three trailing spaces before \n */ 11#1=CARTESIAN_POINT('p0',(0.,0.,0.)); 12#2=CARTESIAN_POINT('p1',(1.,0.,0.)); 13#3=CARTESIAN_POINT('p2',(1.,1.,0.)); 14#4=CARTESIAN_POINT('p3',(0.,1.,0.)); 15#5=DIRECTION('zdir',(0.,0.,1.)); 16#6=DIRECTION('xdir',(1.,0.,0.)); 17#7=GEOMETRIC_CURVE_SET('trailing-ws',()); 18ENDSEC; 19END-ISO-10303-21;