Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid cyclic import detection #315

Open
HolQue opened this issue Jun 4, 2024 · 2 comments
Open

Invalid cyclic import detection #315

HolQue opened this issue Jun 4, 2024 · 2 comments

Comments

@HolQue
Copy link
Collaborator

HolQue commented Jun 4, 2024

A JSON string contains a file import. The imported file contains another import. This imported file also contains another import.

sJSON = """{
   "[import]" : "./imports/imported.jsonp",
   "A" : 1
}"""

The JSON string is handed over to 'jsonLoads':

dictValues = oJsonPreprocessor.jsonLoads(sJSON)

This works like expected. I get all values.

I exchange the relative path to the imported file by the corresponding absolute path:

sJSON = """{
   "[import]" : "D:/SWDEV/Dev_Python_3/TestScript/imports/imported.jsonp",
   "A" : 1
}"""

Now the result is:
Exception: Cyclic imported json file 'D:/SWDEV/Dev_Python_3/TestScript/imports/imported.jsonp'!

But expected is to get the defined values.

No such problem with 'jsonLoad'.

@namsonx namsonx self-assigned this Jun 6, 2024
@namsonx
Copy link
Collaborator

namsonx commented Jun 6, 2024

Hello Holger,

I fixed this issue and pushed to stabi branch.

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented Jun 6, 2024

Retest successful. Issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants