put_object file reset capability sniffing fails

Bug #1216981 reported by Stuart Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
Undecided
Unassigned

Bug Description

In Connection.put_object, the content is sniffed to see if it has tell and seek methods. This allows a reset function to be used to allow retrying of failed uploads.

Unfortunately, some file-like objects define these methods but they don't work. In particular, subprocess.Popen objects cannot be passed in as tell() raises an IOError exception and the upload is never attempted.

Instead, this sniffing could be bypassed entirely if retries has been disabled. This would preserve the current behavior, and let a lot more file-like objects be used.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-swiftclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/45017

Revision history for this message
Pete Zaitcev (zaitcev) wrote :

Stuart, Yuan has a slightly changed fix (review 45017 patch #2), does it work for you?

Revision history for this message
Stuart Bishop (stub) wrote :

Both seem fine for my use case.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

Reviewed: https://review.openstack.org/45017
Committed: http://github.com/openstack/python-swiftclient/commit/dbdbaa0321a709d67464ce777139af910f8b57af
Submitter: Jenkins
Branch: master

commit dbdbaa0321a709d67464ce777139af910f8b57af
Author: Yuan Zhou <email address hidden>
Date: Wed Sep 4 15:20:08 2013 +0800

    Skip sniffing and reseting if retry is disabled

    Bypass sniffing entirely if retries has been disabled.

    Fix bug #1216981

    Change-Id: I593bdc56ca139af5a7f2ca2783ef2de2a96c94fb
    Signed-off-by: Yuan Zhou <email address hidden>

Stuart Bishop (stub)
Changed in python-swiftclient:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.