On 02.04.06 01:15:12, Chris Lawrence wrote:
> On 3/29/06, Andreas Pakulat <[EMAIL PROTECTED]> wrote:
> > There are 2 solutions to this:
> >
> > 1. The easiest: Turn off the Accept-Encoding line in urlutils.py:urlopen
> >
> > 2. find out why reportbug doesn't get that the real response is not
> > gzipped anymore and fix it.
> >
> > I had a quick look for 2 but I couldn't find anything besides that the
> > error happens when the page returned is read().
> 
> I still can't duplicate this problem here.  There is an unrelated bug
> in the package version checking that I just fixed, but reading the
> resulting page doesn't result in any problems here.   I tested with
> both Python 2.3 and 2.4.
> 
> Maybe packages.debian.org redirects somewhere different for requests
> from Europe?  Here, it maps to
> http://packages.debian.org/cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=reportbug,
> which doesn't send a compressed response.

Ok, it seems you were right, there is some type of proxy between me and
p.d.o. I think it is my ISP, but I couldn't find any information about
such things on his website.

Anyway. Something is still wrong here. Using curl to "emulate" the
url-fetching gives the following headers for the 2 responses (the 302
and the real oen):

[EMAIL PROTECTED]:~/qanagram/bin>curl -v --compressed 
packages.debian.org/reportbug
* About to connect() to packages.debian.org port 80
*   Trying 87.106.4.56... connected
* Connected to packages.debian.org (87.106.4.56) port 80
> GET /reportbug HTTP/1.1
> User-Agent: curl/7.15.3 (i486-pc-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.8a 
> zlib/1.2.3 libidn/0.5.18
> Host: packages.debian.org
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 302 Moved Temporarily
< Date: Sun, 02 Apr 2006 17:19:45 GMT
< Server: Apache/1.3.33 (Debian GNU/Linux) mod_perl/1.29
< Location: 
http://packages.debian.org/cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=reportbug
< Content-Type: text/html; charset=iso-8859-1
< Transfer-Encoding: chunked
...

[EMAIL PROTECTED]:~/qanagram/bin>curl -v --compressed 
"packages.debian.org/cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=reportbug"
* About to connect() to packages.debian.org port 80
*   Trying 87.106.4.56... connected
* Connected to packages.debian.org (87.106.4.56) port 80
> GET 
> /cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=reportbug
>  HTTP/1.1
> User-Agent: curl/7.15.3 (i486-pc-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.8a 
> zlib/1.2.3 libidn/0.5.18
> Host: packages.debian.org
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 200 OK
< Content-Length: 1205
< Content-Encoding: gzip
< Date: Sun, 02 Apr 2006 17:20:21 GMT
< Server: Apache/1.3.33 (Debian GNU/Linux) mod_perl/1.29
< Content-Type: text/html; charset=ISO-8859-1
< Connection: keep-alive

I'll try to debug this a bit more during the week. Until now all I
found is that the Response to the redirected request also says it's
compressed. Adding a "data = fp.read()" in urlutils.py:decode right
after the GZipFile is created prevents the exception. But of course than
reportbug still doesn't work correctly.

Andreas

-- 
Good day for a change of scene.  Repaper the bedroom wall.

Attachment: pgpv8PtUGrLtz.pgp
Description: PGP signature

Reply via email to