Closed HolQue closed 8 months ago
Hello Thomas, Hello Holger,
I created new commit 8e1eb4c29 on stabi branch for this ticket.
Thank you, Son
@HolQue : did you retest?
Retest successful.
Reference: JPP_1200-(PATH_FORMATS)-[GOODCASE]
Issue can be closed.
A batch file calls a Python script. Within this Python script a JSON file is loaded in the following way:
json_preprocessor.jsonLoad("./file.jsonp")
Expected is that the path of the executed Python script is the reference for the relative path to the loaded JSON file.
In opposite to this expectation the JsonPreprocessor uses the current working directory. The current working directory depends on the position of the batch file. Therefore this solution only works if batch file and Python script are placed in the same folder. This cannot be assumed in every case and this also should not be a requirement.
CRQ: It has to be coded explicitely, that the path to the executed Python script is the reference for all relative paths, used inside this script.
Proposal:
The line
jFile = CString.NormalizePath(jFile)
has to be replaced by
jFile = CString.NormalizePath(jFile, sReferencePathAbs=os.path.dirname(sys.argv[0]))
This solves the problem.