kennethreitz/requests — Issue #195: Now it seems completely broken.
Author: pyos
Created: 2011-10-12 12:41:52+00:00
State: open

I got several exceptions in a chain.

I was trying to retrieve the response content, when suddenly...

```python
>>> import requests
>>> response = requests.get("http://httpbin.herokuapp.com/")
>>> response.content
Traceback (most recent call last):
File "", line 1, in
File "requests\models.py", line 458, in content
self._content = self.fo.read()
AttributeError: 'Response' object has no attribute 'fo'
```

I tried to fix it with replacing line 162 of models.py (```response.raw = resp```) with ```response.raw = response.fo = resp```, but I got the following error:

```python
>>> import requests
>>> response = requests.get("http://httpbin.herokuapp.com/")
>>> response.content
Traceback (most recent call last):
File "", line 1, in
File "requests\models.py", line 481, in content
if settings.decode_unicode:
NameError: global name 'settings' is not defined
```

Hmm... ```from .config import settings```?

```python
>>> import requests
>>> response = requests.get("http://httpbin.herokuapp.com/")
>>> response.content
Traceback (most recent call last):
File "", line 1, in
File "requests\models.py", line 493, in content
self._content = get_unicode_from_response(self)
File "requests\utils.py", line 291, in get_unicode_from_response
return unicode(r.content, encoding)
File "requests\models.py", line 493, in content
self._content = get_unicode_from_response(self)
...
RuntimeError: maximum recursion depth exceeded
```

Now I'm pretty sure I can't fix that. What is happening?