John Machin wrote:
> On 29/05/2006 10:47 PM, Serge Orlov wrote:
> > Maybe urllib2 in
> > python 2.4 reports to the server that it supports compressed data but
> > doesn't decompress it when receives the reply?
> >
>
> Something funny is happening here. Others reported it working with 2.4.3
> and Ro
On 30/05/2006 12:44 AM, Rocco wrote:
> Thanks Serge.
> It's a gzip string.
Look, Ma, no gzip!!!
C:\junk>rocco_rss.py
'NF
E/1.0type rocco_rss.py
import urllib2
def takefeed(url):
request=urllib2.Request(url)
request.add_header('User-Agent', 'Mozilla/4.0 (compatible; MSIE
5.5; Wi
On 29/05/2006 10:47 PM, Serge Orlov wrote:
> Rocco wrote:
>> Also with ascii the function does not work.
>
> Well, at least you fixed misconfiguration ;)
>
> Googling for 1F8B (that's two first bytes from your strange python 2.4
> result) gives a hint: it's a beginning of gzip stream.
Well done!
Thanks Serge.
It's a gzip string.
So the code is
>>> import urllib2
>>> def takefeed(url):
request=urllib2.Request(url)
request.add_header('User-Agent', 'Mozilla/4.0 (compatible; MSIE
5.5;Windows NT')
opener = urllib2.build_opener()
data=opener.open(request).read()
Rocco wrote:
> Also with ascii the function does not work.
Well, at least you fixed misconfiguration ;)
Googling for 1F8B (that's two first bytes from your strange python 2.4
result) gives a hint: it's a beginning of gzip stream. Maybe urllib2 in
python 2.4 reports to the server that it supports
Also with ascii the function does not work.
--
http://mail.python.org/mailman/listinfo/python-list
Rocco wrote:
> >>> import sys
> >>> sys.getdefaultencoding()
> 'latin_1'
Don't change default encoding. It should be always ascii.
--
http://mail.python.org/mailman/listinfo/python-list
This is the problem when I run the function
this is the result from 2.3.5
>>> print rss
http://purl.org/atom/ns#";>NFE/1.0Google
News Italiahttp://news.google.it/"/>Google News
ItaliaGoogle
Inc.[EMAIL PROTECTED]©2006
Google2006-05-28T19:09:13+00:00
Benedetto XVI: Wojtyla santo subito - LibertÃ
Rocco:
>but does not work with 2.4.3.
Define "does not work".
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Rocco wrote:
> hi
> I made the upgrade to python 2.4.3 from 2.4.2.
> I want to take from google news some atom feeds with a funtion like
> this
> import urllib2
> def takefeed(url):
> request=urllib2.Request(url)
> request.add_header('User-Agent', 'Mozilla/4.0 (compatible; MSIE 5.5;
>
hi
I made the upgrade to python 2.4.3 from 2.4.2.
I want to take from google news some atom feeds with a funtion like
this
import urllib2
def takefeed(url):
request=urllib2.Request(url)
request.add_header('User-Agent', 'Mozilla/4.0 (compatible; MSIE 5.5;
Windows NT')
opener
11 matches
Mail list logo