Skip to content

Commit 4dad6d5

Browse files
committed
convert http response to string while py3
1 parent e7bafe5 commit 4dad6d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oss2/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from .utils import http_to_unixtime, make_progress_adapter, make_crc_adapter
1111
from .exceptions import ClientError, InconsistentError
12-
from .compat import urlunquote
12+
from .compat import urlunquote, to_string
1313
from .headers import *
1414
import json
1515

@@ -840,7 +840,7 @@ def __init__(self, resp):
840840
self.fileSize = 0
841841
self.object = ""
842842
self.process_status = ""
843-
result = json.loads(resp.read())
843+
result = json.loads(to_string(resp.read()))
844844
if 'bucket' in result:
845845
self.bucket = result['bucket']
846846
if 'fileSize' in result:

0 commit comments

Comments
 (0)