Issue 1:
Requests fails on the URL http://www.whatbird.com/forum/index.php?/gallery/image/291517-foo/, which is a 301 redirect to

http://www.whatbird.com/forum/index.php?/gallery/image/291517-title-paused-jewel-allens-hummingbird-a-backyard-bird-painting-in-oil-by-camille-engel/

. The issue seems to be that the server's initial 301 response has a header falsely claiming that the response body (a simple HTML page) is gzipped, when it's actually uncompressed.

When resolving redirects, Requests does (in requests.sessions.resolve_redirects):

resp.content # Consume socket so it can be released

which attempts to decode

One could legitimately say this is the server's problem. However, conceptually, why decode the response body of a redirect, which won't get returned? Other programs (Chromium, Firefox, curl) don't do this. For example, curl gives an error, as expected, when not following redirects:

$ curl --compressed 'http://www.whatbird.com/forum/index.php?/gallery/image/291517-foo/'
curl: (61) Error while processing content unencoding: invalid code lengths set

whereas it works if you add the --location flag (follow redirects).

Example of error

Python 3.3.2+ (default, Oct 9 2013, 14:56:03)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests ; requests.get('http://www.whatbird.com/forum/index.php?/gallery/image/291517-foo/')
Traceback (most recent call last):
File "./requests/packages/urllib3/response.py", line 199, in read
data = self._decoder.decompress(data)
zlib.error: Error -3 while decompressing data: incorrect header check

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./requests/models.py", line 629, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "./requests/packages/urllib3/response.py", line 236, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "./requests/packages/urllib3/response.py", line 204, in read
e)
requests.packages.urllib3.exceptions.DecodeError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "./requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "./requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "./requests/sessions.py", line 393, in request
resp = self.send(prep, **send_kwargs)
File "./requests/sessions.py", line 496, in send
r = adapter.send(request, **kwargs)
File "./requests/adapters.py", line 391, in send
r.content
File "./requests/models.py", line 691, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "./requests/models.py", line 634, in generate
raise ContentDecodingError(e)
requests.exceptions.ContentDecodingError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check',))

Issue 2:
See this issue on Requests: https://github.com/kennethreitz/requests/issues/1472

This is the truncated traceback:

...
/project/virtualenv/lib/python2.6/requests/packages/urllib3/response.py", line 188, in read
"failed to decode it." % content_encoding)
DecodeError: Received response with content-encoding: gzip, but failed to decode it.

cc @schlamar