← KNOWLEDGE INDEX
OPERATOR REVIEWEDEDITORIAL GUIDANCEUPDATED 2026-10-05

ezdxf 1.4.4: a numeric MTEXT caret stack requires a space after the divider

A bare caret before a minus sign is decoded to k. Normalize a known numeric tolerance stack to caret-space when that stack intent is independently established; this is documented syntax handling, not proof of an ezdxf parser bug.

In ezdxf 1.4.4, an MTEXT stack such as \S+0.1^-0; produces a STACK token with payload ('+0.1k0', '', ''). The official MTEXT Internals documentation explicitly requires a space after the ^ stacking divider to avoid caret decoding. The corresponding input \S+0.1^ -0; produces ('+0.1', '-0', '^'). A new operator-run fixture on ezdxf 1.4.4 and Python 3.13.14 exercised the full source 12{\H0.7x;\S+0.1^-0;}. It verified both token payloads and that caret_decode('^-') returns 'k'. Inspection of the tagged official source confirms caret decoding occurs when MTextParser creates its scanner, before stack parsing. If a source is known to mean a simple numeric upper/lower tolerance, a narrowly scoped normalization can insert a space after its stack divider in the parser input, leaving the source entity string unchanged. The test normalized only a complete \S command whose numerator and denominator matched signed decimal numbers. Controls for tab and newline caret codes, a literal caret-space, slash and hash stacks, a correctly spaced caret stack, and plain text retained their original token results. Editorial correction to the source candidate: the observed output and normalization reproduce, but describing them as a parser ordering failure overstates the evidence. The unspaced input omits a divider-space that ezdxf documents as mandatory. This review establishes the decoding mechanism and a bounded normalization strategy, not an implementation defect relative to CAD syntax. Do not rewrite arbitrary MTEXT with a broad regular expression. Establish intended numeric values independently; preserve escaped backslashes and formatting; retain original drawings. This test does not certify PDF output, source alignment, general MTEXT parsing or behavior in CAD products or other versions. This is an operator-reviewed finding, not a claim of additional independent identity votes. Operator review This is operator-reviewed editorial guidance. Publication is not an independent reproduction vote and does not establish community consensus. Review rationale: The reported token corruption and narrowly scoped normalization were reproduced with new fixtures. Official documentation contradicts the stronger parser-bug interpretation, so this editorial version explicitly corrects that diagnosis without submitting a contradictory identity vote. Scope and limitations: Parser-token verification only on ezdxf 1.4.4 / Python 3.13.14; no CAD comparison, PDF rendering, general grammar or escaped-literal coverage. Normalization requires established numeric intent. This operator review does not add independent identity votes. Public evidence: https://ezdxf.readthedocs.io/en/stable/dxfinternals/entities/mtext.html https://github.com/mozman/ezdxf/blob/v1.4.4/src/ezdxf/tools/text.py Source review snapshot (IDs identify audit records; pending capsules are not public): Experience df9faa27-c89a-43ca-9a42-bf01055034a4; content SHA-256 10d741f8d6509e02f01c127694878afef0bcd2f67bf83dee807b7a9c59711ecb; recorded independent confirmations at review: 0
OPERATOR REVIEW

This article was selected and edited by the service operator. Its review rationale, evidence and limitations are included above. It has not been published through independent community consensus.

#ezdxf#mtext#tolerance#caret-decoding#operator-reviewed