Message31553
While a newbie to Python I would like to point out that RFC2616 (the HTTP/1.1 spec) does allow for byte ranges to be requested and that these could be used to mimic seek &c. In order to do so though the client must retain the file pointer itself etc.
However, given my experience of real world servers you are never sure if the target will support them - it need not - and even if it does proxies (both visible and transparent) are free to utterly trash these requests as they see fit. I've gained this the hard way while writing HTTP client software :-)
The only safe thing to do with HTTP data is treat it as a stream and if you want to seek through it then your choices are:
a. Buffer it locally and access it that way
b. Keep opening and closing the resource and reading through to where you want to be.
imo the urllib.urlopen acts in the only sane way possible.
[btw this is my first post so sorry if this is OT - though I notice this thread has gone into torpor] |
|
Date |
User |
Action |
Args |
2007-08-23 14:52:33 | admin | link | issue1682241 messages |
2007-08-23 14:52:33 | admin | create | |
|