Message31546
> If you need to seek, you can wrap the file-like object in a
> StringIO (which is what urllib would have to do internally
> [...] )
I think it's really a bug, or at least a non-pythonic method.
I use the method you wrote, but this must be done manually,
and I don't know why. Actually without this "trick" you can't
handle url and file objects together as they don't work in
the same manner. I think it's not too complicated using the
internal StringIO object in urllib class when I must seek()
or use other file-like methods.
> You can check the type of the response content before you try
> to uncompress it via the Content-Encoding header of the
> response
It's not a generic solution
(thanks anyway for suggested solutions :) ) |
|
Date |
User |
Action |
Args |
2007-08-23 14:52:32 | admin | link | issue1682241 messages |
2007-08-23 14:52:32 | admin | create | |
|