Skip to content
Myr

Merge pull request #475 from umbrae/generate-chunked-valueerror-fix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Generate chunked ValueError fix

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 2f91d8e, bd0e002 · Browse files · 3 files+9 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+9 added−2 removed

  • tests:+6 added−2 removed
  • other:+3 added−0 removed

3 files+9 added−2 removed

modified:requests/models.py+3 added
671 unmodified lines
672 fp.read(2) # throw away crlf673 while 1:674 #XXX correct line size? (httplib has 64kb, seems insane)675 pending_bytes = fp.readline(40).strip()676 if pending_bytes == '':677 # No content, like a HEAD request. Break out.678 break679 pending_bytes = int(pending_bytes, 16)680 if pending_bytes == 0:681 break682 while pending_bytes:
119 unmodified lines
modified:tests/test_requests_ext.py+6 added
51 unmodified lines
52 def test_unicode_error(self):53 url = u'http://blip.fm/~1abvfu'54 requests.get(url)555657 def test_chunked_head_redirect(self):58 url = "http://t.co/NFrx0zLG"59 r = requests.head(url, allow_redirects=True)60 self.assertEqual(r.status_code, 200)6162if __name__ == '__main__':63 unittest.main()64
modified:tests/test_requests.py-2 removed
795 unmodified lines
796 def test_empty_response(self):797 r = requests.get(httpbin('status', '404'))798 r.text799800801800if __name__ == '__main__':801 unittest.main()