Skip to content

Commit

Permalink
GDCDEVOPS-527 update string checks to use six.string_type/bytesio (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfOak authored Jul 13, 2020
1 parent 56263dd commit 5a7feee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cdisutils/storage3.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import sys
import time
from builtins import next, object, str, zip
from io import StringIO as BIO
from urllib.parse import urlparse

import boto3
import urllib3
import six
from botocore.exceptions import ClientError

from .log import get_logger
Expand Down Expand Up @@ -345,7 +345,7 @@ def create_multipart_upload(self, src_url=None, dst_url=None):

multipart_info["dst_info"] = self.parse_url(url=dst_url)
multipart_info["src_info"] = self.parse_url(url=src_url)
multipart_info["stream_buffer"] = BIO()
multipart_info["stream_buffer"] = six.BytesIO()
multipart_info["mp_chunk_size"] = self.mp_chunk_size
multipart_info["download_chunk_size"] = self.chunk_size
multipart_info["cur_size"] = 0
Expand Down Expand Up @@ -404,7 +404,7 @@ def upload_multipart_chunk(self, mp_info):
else:
mp_info["cur_size"] = 0
mp_info["stream_buffer"].close()
mp_info["stream_buffer"] = BIO()
mp_info["stream_buffer"] = six.BytesIO()
mp_info_part = {
"ETag": result["ETag"],
"PartNumber": mp_info["chunk_index"],
Expand All @@ -424,10 +424,10 @@ def copy_multipart_file(
multipart between object stores
"""

if isinstance(src_info, str):
if isinstance(src_info, six.string_types):
src_url = src_info
src_info = self.parse_url(url=src_url)
if isinstance(dst_info, str):
if isinstance(dst_info, six.string_types):
dst_url = dst_info
dst_info = self.parse_url(url=dst_url)

Expand Down

0 comments on commit 5a7feee

Please sign in to comment.