Skip to content

Commit b681e78

Browse files
author
Clement Champetier
committed
pyTest testCheckFilePropertiesAsJson: windows fix to remove the offending characters of json to load
1 parent 5bbb898 commit b681e78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/pyTest/testProperties.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def testCheckFilePropertiesAsJson():
138138
inputFile = av.InputFile( inputFileName )
139139

140140
import json
141-
# throw exception if it is not a valid JSON
142-
json.loads(inputFile.getProperties().allPropertiesAsJson())
143-
144-
141+
propertiesAsJson = inputFile.getProperties().allPropertiesAsJson()
142+
# json.loads method throws a ValueError if it is not a valid JSON.
143+
# Windows fix: remove the offending characters before loading it.
144+
json.loads(propertiesAsJson.replace('\r\n', ''))

0 commit comments

Comments
 (0)