Request freezes when doing 'r.text' 

Summary.

I am trying to use Requests to access a URL. This URL requires certain headers, and values in the cookies. I am able to access the URL fine using Hurl.it/Postman but when using Requests, my laptop freezes up and all my RAM is eaten when I do r.text, r.json() or r.content

## Expected Result

Print out the content of the returned HTML page

## Actual Result

Laptop Freezes - all RAM used up, need to shutdown Jupyter notebook

## Reproduction Steps

```python
import requests

url = "http://www.asinlab.com/php/convertfromasin.php?asin_num=B006OC2ANS,B00HWD2OE8,B00J06HWC4,B00CH87HF4,B00B7ERH04&id_type=UPC&bulk=true&x=false"
header = {}
cookie = {}
header["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
header["Accept-Encoding"] = "gzip, deflate"
header["Accept-Language"] = "en-US,en;q=0.9"
cookie["PHPSESSID"] = "7265269b431e4d9d9e4edd079f8da21c"
cookie["sc_is_visitor_unique"] = "rx11430932.1524382929.F7A1330878D04FF9DF09539FE782C5B9.1.1.1.1.1.1.1.1.1"
header["Referer"] = "http://www.asinlab.com/asin-to-upc-bulk-lookup/"
header["User-Agent"] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"

r = requests.get(url=url, headers=header, cookies=cookie, allow_redirects=False)
r.text 
```

## System Information

    $ python -m requests.help

```
{
  "chardet": {
    "version": "3.0.4"
  }, 
  "cryptography": {
    "version": ""
  }, 
  "idna": {
    "version": "2.6"
  }, 
  "implementation": {
    "name": "CPython", 
    "version": "2.7.14"
  }, 
  "platform": {
    "release": "17.4.0", 
    "system": "Darwin"
  }, 
  "pyOpenSSL": {
    "openssl_version": "", 
    "version": null
  }, 
  "requests": {
    "version": "2.18.4"
  }, 
  "system_ssl": {
    "version": "100020ef"
  }, 
  "urllib3": {
    "version": "1.22"
  }, 
  "using_pyopenssl": false
}

```

```py
>>> r.status_code
200
>>> r.headers
{'Date': 'Sun, 22 Apr 2018 13:04:55 GMT', 'Server': 'Apache', 'X-Powered-By': 'PHP/7.1.14', 'Expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'Cache-Control': 'no-store, no-cache, must-revalidate', 'Pragma': 'no-cache', 'Vary': 'Accept-Encoding,User-Agent', 'Content-Encoding': 'gzip', 'Keep-Alive': 'timeout=5', 'Connection': 'Keep-Alive', 'Transfer-Encoding': 'chunked', 'Content-Type': 'text/html; charset=UTF-8'}
```

This indicates to me that it's a very large file that you're attempting to decode in memory. Regardless, `r.text` does not consume all of my memory.

```py
>>> len(r.content)
2100859
>>> len(r.text)
2100859
```

Hi!

Thanks for your reply. Is there any suggested solution to this?

I'm trying to build a real-time application that can fetch the data from the URL and then use BeautifulSoup to scrape the returned HTML for what I need.

I've let the r.text and r.content sit for almost 10 mins before I inevitably had to kill the process.

I just noticed you mentioned you were using Jupyter Notebook. Can you try in a regular python shell?

And testing in Jupyter notebook (v4.4.0) I can't reproduce this with the cod eyou've provided. Without knowing what is happening here, I can't provide a suggested solution.

How much RAM do you have?

Hi!

To be honest I'm not sure what the issue was. I was running it on an 8GB
Macbook Pro 2015. Ran the same exact code on another 8GB Macbook Pro (2016)
and it worked fine.





‌

On Sat, May 12, 2018 at 2:24 PM, PokestarFan <notifications@github.com>
wrote:

> How much RAM do you have?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/requests/requests/issues/4605#issuecomment-388577227>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AIAas_ugyiRAGM44Pvq1Fcxp-IqvfHuIks5txzcDgaJpZM4Texra>
> .
>



-- 
Thank you,
Puneet Kohli


Hey @PuneetKohli, since this appears to be localized to a single machine and unreproducible, I'm going close this out. Please feel free to update this issue if you find further information. Thanks!