In article <4c645c39$0$1595$742ec...@news.sonic.net>,
John Nagle wrote:
>
>I'm reading a URL which is a .gz file, and decompressing it. This
>works, but it seems far too complex. Yet none of the "wrapping"
>you might expect to work actually does. You can't wrap a GzipFile
>around an HTTP conne
On Thursday 12 August 2010, it occurred to John Nagle to exclaim:
> (Repost with better indentation)
Good, good.
>
> def readurl(url) :
> if url.endswith(".gz") :
The file name could be anything. You should be checking the reponse Content-
Type header -- that's what it's for.
> n
(Repost with better indentation)
I'm reading a URL which is a .gz file, and decompressing
it. This works, but it seems far too complex. Yet
none of the "wrapping" you might expect to work
actually does. You can't wrap a GzipFile around
an HTTP connection, because GzipFile, reasonably enough,
I'm reading a URL which is a .gz file, and decompressing
it. This works, but it seems far too complex. Yet
none of the "wrapping" you might expect to work
actually does. You can't wrap a GzipFile around
an HTTP connection, because GzipFile, reasonably enough,
needs random access, and tries t