Function Calls BOOL Parameters not accepting 1 or 0 now?

When did system.* function calls stop accepting 0 or 1 for boolean parameters?
We just upgraded a gateway to 8.1.35 and noticed it.

for example:
event.source.text = system.gui.showTouchscreenKeyboard('', 14, 0)
Works just fine in 8.1.9
But will fail on 8.1.35

Traceback (most recent call last):
  File "<event:mouseClicked>", line 1, in <module>
TypeError: showTouchscreenKeyboard() argument passwordMode: expected Boolean instance, PyInteger found


Ignition v8.1.35 (b2023120517)
Java: Azul Systems, Inc. 17.0.8

Is this the way it is going to be going forward?
Is it a regression?
Just wondering, and already added to our check list of things to watch out for on upgrades.

This particular function happened to migrate to using keyword arguments (to support the extra arguments added for the international keyboard stuff). In the process, the argument parsing was made a bit more strict - not exactly intentionally, but not exactly by accident either.

This won't "just happen" unless changes are made on our end in the code. You could call this a regression - feel free to email into support and we could end up relaxing the parsing code for keyword arguments to allow integers are booleans. I personally consider it a smell, relying on type coercion like that, but I know some folks are used to 1/0 as booleans so I won't die on the hill.

1 Like

Some insufficiently-darned databases, too. You should relax this.

1 Like

Meh. PotHEYto, PoTAHto..
We are aware of it now, so it's just part of our upgrade checks.
Might be a good idea to have these kinds of changes in the version change logs though. :man_shrugging:

Yeah, I've convinced myself of that. I'll get it in an upcoming 8.1.X release.

3 Likes