Skip to content

Commit cd8f248

Browse files
chaenweb-flow
authored andcommitted
sweep: #5669 Fix decoding of content in WLCGAccountingHTTPJson
1 parent 3d92153 commit cd8f248

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from __future__ import division
1212
from __future__ import print_function
1313

14+
import os
1415
import requests
1516

1617
from DIRAC.Core.Security.Locations import getCAsLocation
@@ -48,6 +49,7 @@ def _downloadJsonFile(self, occupancyLFN, filePath):
4849
caPath = getCAsLocation()
4950
res = requests.get(occupancyLFN, verify=caPath)
5051
res.raise_for_status()
51-
fd.write(res.content)
52+
fd.write(res.text)
5253
except Exception as e:
5354
self.log.debug("Exception while copying", repr(e))
55+
os.remove(filePath)

0 commit comments

Comments
 (0)