diff options
author | Daniel G. Taylor <danielgtaylor@gmail.com> | 2015-03-11 15:20:18 -0700 |
---|---|---|
committer | Daniel G. Taylor <danielgtaylor@gmail.com> | 2015-03-11 15:20:18 -0700 |
commit | 4ffd9babf7f3812b5a573cc50afc5ec458984c11 (patch) | |
tree | b3e589360abb852163e8db764474e080627ca595 | |
parent | 561716cdac49529dc898a32e1a1e8a6531791b49 (diff) | |
parent | 4f4fc7d58b388cb5f62bd34593d3e565656b4058 (diff) | |
download | boto-4ffd9babf7f3812b5a573cc50afc5ec458984c11.tar.gz |
Merge pull request #3018 from farthVader/patch-1
Fix division calculation in S3 docs. Fixes #3018.
-rw-r--r-- | docs/source/s3_tut.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/source/s3_tut.rst b/docs/source/s3_tut.rst index 83093bfa..23e0350d 100644 --- a/docs/source/s3_tut.rst +++ b/docs/source/s3_tut.rst @@ -190,12 +190,12 @@ to be taken. The example below makes use of the FileChunkIO module, so # Use a chunk size of 50 MiB (feel free to change this) >>> chunk_size = 52428800 - >>> chunk_count = int(math.ceil(source_size / chunk_size)) + >>> chunk_count = int(math.ceil(source_size / float(chunk_size))) # Send the file parts, using FileChunkIO to create a file-like object # that points to a certain byte range within the original file. We # set bytes to never exceed the original file size. - >>> for i in range(chunk_count + 1): + >>> for i in range(chunk_count): >>> offset = chunk_size * i >>> bytes = min(chunk_size, source_size - offset) >>> with FileChunkIO(source_path, 'r', offset=offset, |