Re: why not in python 2.4.3

2006-05-29 Thread Serge Orlov
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

Re: why not in python 2.4.3

2006-05-29 Thread John Machin
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

Re: why not in python 2.4.3

2006-05-29 Thread John Machin
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!

Re: why not in python 2.4.3

2006-05-29 Thread Rocco
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()

Re: why not in python 2.4.3

2006-05-29 Thread Serge Orlov
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

Re: why not in python 2.4.3

2006-05-29 Thread Rocco
Also with ascii the function does not work. -- http://mail.python.org/mailman/listinfo/python-list

Re: why not in python 2.4.3

2006-05-28 Thread Serge Orlov
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

Re: why not in python 2.4.3

2006-05-28 Thread Rocco
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Ã

Re: why not in python 2.4.3

2006-05-28 Thread Rene Pijlman
Rocco: >but does not work with 2.4.3. Define "does not work". -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: why not in python 2.4.3

2006-05-28 Thread Carl Banks
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; >

why not in python 2.4.3

2006-05-28 Thread Rocco
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