# Buggy code
def __init__(
    self,
    name,
    value,
    storage="STANDARD",
    etag=None,
    is_versioned=False,
    version_id=0,
    max_buffer_size=DEFAULT_KEY_BUFFER_SIZE,
    multipart=None,
):
    self.name = name
    self.last_modified = datetime.datetime.utcnow()
    self.acl = get_canned_acl("private")
    self.website_redirect_location = None
    self._storage_class = storage if storage else "STANDARD"
    self._metadata = {}
    self._expiry = None
    self._etag = etag
    self._version_id = version_id
    self._is_versioned = is_versioned
    self._tagging = FakeTagging()
    self.multipart = multipart

    self._value_buffer = tempfile.SpooledTemporaryFile(max_size=max_buffer_size)
    self._max_buffer_size = max_buffer_size
    self.value = value


# Traceback (botocore.exceptions.ClientError)
Traceback (most recent call last):
File "/Users/myuser/projects/project/web/pdf_file_downloader.py", line 16, in download
self.s3.download_file(self.bucket_name, self.file_name, self.local_path())
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/boto3/s3/inject.py", line 172, in download_file
extra_args=ExtraArgs, callback=Callback)
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/boto3/s3/transfer.py", line 307, in download_file
future.result()
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/s3transfer/futures.py", line 106, in result
return self._coordinator.result()
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/s3transfer/futures.py", line 265, in result
raise self._exception
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/s3transfer/tasks.py", line 126, in __call__
return self._execute_main(kwargs)
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/s3transfer/tasks.py", line 150, in _execute_main
return_value = self._main(**kwargs)
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/s3transfer/download.py", line 512, in _main
Bucket=bucket, Key=key, **extra_args)
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/botocore/client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/project-X5XCMv3p-py3.6/lib/python3.6/site-packages/botocore/client.py", line 626, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (416) when calling the GetObject operation: Requested Range Not Satisfiable

# Fixed code
def __init__(
    self,
    name,
    value,
    storage="STANDARD",
    etag=None,
    is_versioned=False,
    version_id=0,
    max_buffer_size=DEFAULT_KEY_BUFFER_SIZE,
    multipart=None,
):
    self.name = name
    self.last_modified = datetime.datetime.utcnow()
    self.acl = get_canned_acl("private")
    self.website_redirect_location = None
    self._storage_class = storage if storage else "STANDARD"
    self._metadata = {}
    self._expiry = None
    self._etag = etag
    self._version_id = version_id
    self._is_versioned = is_versioned
    self._tagging = FakeTagging()
    self.multipart = multipart

    self._value_buffer = tempfile.SpooledTemporaryFile(max_size=max_buffer_size)
    self._max_buffer_size = max_buffer_size
    self.value = value
    self.lock = threading.Lock()