boto/boto — pull request #643 by tpodowd (2012-03-19 06:01:54+00:00)
Title: Protect set_contents_from_file() against potential dataloss (Issue #630)

- Since boto 2.1, set_contents_from_file() stopped rewinding the
file pointer to the start of the file to give the caller more
control over what data was written. This is useful for multipart
objects and other situations where you want to read from a
certain offset in the file pointer. Some uses of this api however
rely on the old rewind behaviour. In order to aid this transition
to the new behaviour, the API will now throw an AttributeError
exception if it detects the user is trying to read from the eof
when valid data exists before the file pointer.

- Another addition is the rewind flag. If set to True, the API will
rewind the file pointer before reading from it. The default is
False.

- The set_contents_from_file() API now also returns the number of
bytes written.

- Added a unit test to cover this issue and also updated Google Storage
to get coverage.