Closed Bug 1032114 Opened 8 years ago Closed 8 years ago

TPS fails to decode Windows file paths in config file


(Testing Graveyard :: TPS, defect)

Windows 7
Not set


(firefox31 fixed, firefox32 fixed, firefox33 fixed)

Tracking Status
firefox31 --- fixed
firefox32 --- fixed
firefox33 --- fixed


(Reporter: cosmin-malutan, Assigned: cosmin-malutan)





(1 file)

While running tps testruns on a windows slave I've got the following error:
The exact log I've got was:
>21:11:36     config = json.loads(configcontent)
>21:11:36   File "C:\Python27\Lib\json\", line 338, in loads
>21:11:36     return _default_decoder.decode(s)
>21:11:36   File "C:\Python27\Lib\json\", line 365, in decode
>21:11:36     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
>21:11:36   File "C:\Python27\Lib\json\", line 381, in raw_decode
>21:11:36     obj, end = self.scan_once(s, idx)
This was because on config file we had escaped characters (backslash) "\" instead of slash ('/').
As a workaround I replaced the '\' with '//' in tps cli, but I guess this could be also fixed in script where we writhe the JSON file.
config = json.loads(configcontent.replace("\\", "//"))
Since when does this problem occur? I mean what regressed that functionality?
Attached patch patch v1.0Splinter Review
I don't know if this regressed somewhere or if I had different settings when I created the script.
Best would be replace the backslashes before we write down the config file, as they escape characters. Also we don't have to check the os because only on windows we have backslashes in config file. I ran this on mac and windows and now I'm running on linux.
Assignee: nobody → cosmin.malutan
Attachment #8447990 - Flags: review?(hskupin)
Comment on attachment 8447990 [details] [diff] [review]
patch v1.0

Review of attachment 8447990 [details] [diff] [review]:

I only call this a pretty bad workaround. What we actually should do here is to properly load and save the config via the json module. That will ensure that we will get proper paths. Given that we have to get the framework working, we need this immediately. Please file a follow-up bug for the real fix.

Also this is one more situation when a patch has not been tested. In this case the one from bug 1009004.
Attachment #8447990 - Flags: review?(hskupin) → review+
Summary: TPS cli fails to decode the config.json on windows → TPS fails to decode Windows file paths in config file

Don't forget to set the status flags which versions are affected.
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.