Skip to content

[ 2374941 ] Leading zeros in decimal integer #350

@HolQue

Description

@HolQue

Implicit creation of a nested dictionary:

${params.001.param} : 2

Result:

Error: 'Could not set parameter '${params.001.param}' with value '2'! Reason: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers (<string>, line 1)'!

How to handle this?

In this combination it works properly:

"params" : {"001" : {"param" : 1}},
${params.001.param} : 2

Also this works properly:

${params}['001']['param'] : 1

Also no problems with:

${params.1.param} : 1

and with:

${params.a001.param} : 2

In Python 3, dictionary keys can also be of type int. But as per my understanding, JSON does not support numeric keys.
Every key is of type str. How does the JsonPreprocessor handle expressions like:

${params.1.param} : 1

Is the key 1 of type int or of type str? If str, leading zeros should not harm the computation. And I have currently no idea why the
JsonPreprocessor should make 1 an integer.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions