From b0bbc8ba5cc7f29833dd9425ac24b3a202c12089 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 6 Sep 2016 21:23:13 -0700 Subject: [PATCH] Fix examples to indicate that we should be using streams. (#403) Fixes https://github.com/minio/minio-py/issues/402 --- docs/API.md | 6 +++--- examples/get_object.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/API.md b/docs/API.md index f1fc41907..94017a1d0 100644 --- a/docs/API.md +++ b/docs/API.md @@ -335,7 +335,7 @@ __Return Value__ |Param |Type |Description | |:---|:---|:---| -|``object`` | _io.IOBase_ |Represents object reader. | +|``object`` | _urllib3.response.HTTPResponse_ |Represents http streaming reader. | __Example__ @@ -346,7 +346,7 @@ __Example__ try: data = minioClient.get_object('mybucket', 'myobject') with open('my-testfile', 'wb') as file_data: - for d in data: + for d in data.stream(32*1024): file_data.write(d) except ResponseError as err: print(err) @@ -370,7 +370,7 @@ __Return Value__ |Param |Type |Description | |:---|:---|:---| -|``object`` | _io.IOBase_ |Represents object reader. | +|``object`` | _urllib3.response.HTTPResponse_ |Represents http streaming reader. | __Example__ diff --git a/examples/get_object.py b/examples/get_object.py index c0411c9df..68e23d9c7 100644 --- a/examples/get_object.py +++ b/examples/get_object.py @@ -27,7 +27,7 @@ try: data = client.get_object('my-bucketname', 'my-objectname') with open('my-testfile', 'wb') as file_data: - for d in data: + for d in data.stream(32*1024): file_data.write(d) except ResponseError as err: print(err)