[Checkins] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/app/http/ Conform to RFC2616 for PUT requests by returning a Location-header.

Christian Theune ct at gocept.com
Fri Sep 29 01:47:23 EDT 2006


Good morning,

Gary Poster wrote:
> 
> On Sep 28, 2006, at 1:51 PM, Marius Gedminas wrote:
>> Ouch!  This change broke HTTP PUT for an application I'm working on.
>> [...]
>> but my reading of it is that each write() is supposed to completely
>> replace the existing file data, especially when you consider it in
>> context (IReadFile.read() returns the whole file data).

Well. Almost. On Python's file-like objects, read() returns the data
until the end of the file whereas write can be called multiple times to
write new data into the file.

>> Please revert this part of your change.
> 
> Christian/Wolfgang, could you reply? 

Sure. We've been sound asleep in the last hours though. :)

> I'm afraid I haven't looked at the
> change, but I do see the error.  Could you revert, or compellingly argue
> why not? :-)

I admit I haven't looked at the interface, but thought this was a
non-intrusive change that was covered by a unit test. Wrong and bad me.
I'll revert the change.

I'll make the IWriteFile-interface a bit more explicit in the same step.
Maybe the unit test didn't cover it because al lthe data passed in was
smaller than 2**6 Bytes. Darn.

This teaches me to fix something while going along!

An annotation to the interface from my side: this isn't very pythonic in
the sense of duck-typing. If it's a "file" interface and has a "write"
method I should be able to derive that it behaves like a Python
file-like object. :/ The method's name have been better as "update" or
"set" or whatever, but not write.

Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/zope3-checkins/attachments/20060929/37281b85/signature.bin


More information about the Zope3-Checkins mailing list