[Bug]: human_to_eng() silently accepts ambiguous 'm' suffix #3
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
human_to_eng()acceptsmas milli, which can silently misinterpret user input in fields where that is probably not what was meant.Current code context
Why this is a problem
In practice, an input like
1min a frequency field is much more likely to be a user typo or shorthand for something else than a deliberate request for milli-Hz.That means the current behaviour can silently send a completely wrong value to the instrument without any warning in the log.
Fix approach
Add input validation for ambiguous suffix usage and log a warning when
mis used in contexts where it is likely unsafe or misleading.Possible options:
ms,mV,kHz,MHz, etc.Status
Still open.
Not fixed in the current v0.2 working copy.
human_to_eng() silently accepts ambiguous 'm' suffixto [Bug]: human_to_eng() silently accepts ambiguous 'm' suffixFixed in v0.2.6.
human_to_eng()no longer silently accepts baremas milli. This was unsafe because inputs like1mcould be interpreted as1e-3and sent to the instrument without any warning.The parser now rejects ambiguous bare
m/Minput and requires explicit units instead, for examplems,mV,kHz, orMHz. The affected GUI apply paths were also updated so invalid ambiguous input is refused and logged, instead of being converted and sent.Result:
msuffix no longer slips through silently