Bug Description
A naming: pattern in a .qp schema: block is applied lazily, so a malformed one fails when the first bus path resolves through it. _resolve_bus_path narrows its except to (AttributeError, KeyError), which catches only the unknown-placeholder case. A malformed format string, a positional placeholder, or a format spec the substituted text cannot satisfy all raise out of loads unwrapped, with no line number.
Minimal Reproducible Example
import qprogram as qp
for pattern in ("{", "{0}", "{index:d}"):
body = f'#!QProgram 1.0\n\nschema:\n naming: "{pattern}"\n element q:\n drive info=IQ\n\nbody:\n play q[0].drive "p"\n'
qp.loads(body)
Expected Behavior
A ParseError on the naming: line, or on the bus-path line, the way an unknown placeholder already reports: Line 7: bus path 'q[0].drive' does not resolve against the program schema: 'foo'.
Actual Behavior
ValueError: Single '{' encountered in format string
IndexError: Replacement index 0 out of range for positional args tuple
ValueError: Unknown format code 'd' for object of type 'str'
.qp Text
#!QProgram 1.0
schema:
naming: "{0}"
element q:
drive info=IQ
body:
play q[0].drive "p"
System Information
qprogram 0.1.0
python 3.14.7 | Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.43
vendors none
Bug Description
A
naming:pattern in a.qpschema:block is applied lazily, so a malformed one fails when the first bus path resolves through it._resolve_bus_pathnarrows itsexceptto(AttributeError, KeyError), which catches only the unknown-placeholder case. A malformed format string, a positional placeholder, or a format spec the substituted text cannot satisfy all raise out ofloadsunwrapped, with no line number.Minimal Reproducible Example
Expected Behavior
A
ParseErroron thenaming:line, or on the bus-path line, the way an unknown placeholder already reports:Line 7: bus path 'q[0].drive' does not resolve against the program schema: 'foo'.Actual Behavior
.qp Text
System Information
qprogram 0.1.0 python 3.14.7 | Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.43 vendors none