Remove fp seek check in s3 set_contents_from_file if fp cannot seek #1273

Open
wants to merge 1 commit into
from

Projects

None yet

4 participants

@peterbrook

Some file-like objects do not support seeking. If the size and md5 of the
underlying data are already known in advance, it is possible and desirable to
read the stream only when we are actually sending the bytes to the storage
service. The current fp.seek calls in this block are simply a sanity check that
a user didn't pass in an already-advanced fp, and can safely be avoided if the
fp does not support seeking.

@peterbrook peterbrook Remove fp seek check if fp cannot seek
Some file-like objects do not support seeking. If the size and md5 of the
underlying data is already known in advance, it is possible and desirable to
read the stream only when we are actually sending the bytes to the storage
service. The current fp.seek calls are simply a sanity check that a user didn't
pass in an already-advanced fp, and can safely be avoided if the fp does not
support seeking.
bec167d
@garnaat
Member
garnaat commented Feb 21, 2013

This pull request seems reasonable but is based off an older version of the code. Could rebase to the current code?

@marrotte

I just ran into this issue and would like to see the feature added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment