On Mon, Mar 24, 2008 at 7:34 PM, Ian Bicking <[EMAIL PROTECTED]> wrote:
>  > Would you know of any Python example code for the MIME multipart/
>  > byteranges encoding for HTTP off the top of your head?  I'll take a
>  > look at CherryPy which I believe supports it and look into MimeWriter.
>
>  I've never actually heard of multipart/byteranges, so no, I've never
>  seen anything about it.  The email module has a bunch of MIME multipart
>  handling.  Even if it doesn't have specific byteranges support it can
>  probably construct that.

This may or may not be useful, but I wrote a bunch of code
which correctly handles the difficult part of multipart/byteranges
and have been using it in real production systems for a while
now.

It's not integrated into any particular web platform, but should be easy
enough to incorporate into your own code.  See

   http://deron.meranda.us/python/httpheader/

There's some example code on that page as well which shows you
how to deal with HTTP range requests correctly.

If you want to know more, specifically look at the function
parse_range_header() and the classes range_set and range_spec.
This is all coded to precisely and comprehensively match the
RFC spec.  And if you haven't read the RFC closely, I highly
recommend you do.  There are some "surprises" in how byte
ranges work that aren't immediately obvious.

If anybody's really interested in this, I can try to clean this
stuff up and perhaps turn it into a more polished python
package and publish it on PyPI (easy_install).  Let me know.
-- 
Deron Meranda

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to