Skip to content

Commit a383421

Browse files
committed
fix(FileHelper): Give io.BytesIO on Python3
1 parent a568604 commit a383421

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/DIRAC/Core/DISET/private/FileHelper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import threading
1313

1414
import six
15-
from six import StringIO
15+
from six import StringIO, BytesIO
1616

1717
from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR
1818
from DIRAC.FrameworkSystem.Client.Logger import gLogger
@@ -145,11 +145,11 @@ def errorInTransmission(self):
145145
def networkToString(self, maxFileSize=0):
146146
"""Receive the input from a DISET client and return it as a string"""
147147

148-
stringIO = StringIO()
149-
result = self.networkToDataSink(stringIO, maxFileSize=maxFileSize)
148+
bytesIO = BytesIO()
149+
result = self.networkToDataSink(bytesIO, maxFileSize=maxFileSize)
150150
if not result["OK"]:
151151
return result
152-
return S_OK(stringIO.getvalue())
152+
return S_OK(bytesIO.getvalue())
153153

154154
def networkToFD(self, iFD, maxFileSize=0):
155155
dataSink = os.fdopen(iFD, "wb")

0 commit comments

Comments
 (0)