Switch use of cStringIO.StringIO to io.BytesIO
This commit switches all our uses of cStringIO.StringIO to io.BytesIO. The StringIO class is the wrong class to use for this, especially considering that subunit v2 is binary and not a string. This commit fixes it so we're using the proper type. Change-Id: I5d21f7ca2f40cbd5c2659f6cee1570ebe2d4a983
This commit is contained in:
parent
e12fc216ed
commit
ad3cc21c67
|
@ -15,10 +15,10 @@
|
|||
# under the License.
|
||||
|
||||
import argparse
|
||||
import cStringIO
|
||||
import daemon
|
||||
import gear
|
||||
import gzip
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
@ -121,14 +121,14 @@ class SubunitRetriever(threading.Thread):
|
|||
return None
|
||||
if gzipped:
|
||||
logging.debug("Decompressing gzipped source file.")
|
||||
raw_strIO = cStringIO.StringIO(raw_buf)
|
||||
raw_strIO = io.BytesIO(raw_buf)
|
||||
f = gzip.GzipFile(fileobj=raw_strIO)
|
||||
buf = cStringIO.StringIO(f.read())
|
||||
buf = io.BytesIO(f.read())
|
||||
raw_strIO.close()
|
||||
f.close()
|
||||
else:
|
||||
logging.debug("Decoding source file.")
|
||||
buf = cStringIO.StringIO(raw_buf)
|
||||
buf = io.BytesIO(raw_buf)
|
||||
return buf
|
||||
|
||||
def _get_subunit_data(self, source_url, retry):
|
||||
|
|
Loading…
Reference in New Issue