Skip to content
Myr

fo => raw

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 030d877 · Browse files · 1 file+5 added−5 removed
This commit

State

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

Diff stats

1 file+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:requests/models.py+5 added-5 removed
187 unmodified lines
188 response.status_code = getattr(resp, 'code', None)189190 try:191 response.headers = CaseInsensitiveDict(getattr(resp.info(), 'dict', None))192 response.fo = resp192 response.raw = resp193194 if self.cookiejar:195 response.cookies = dict_from_cookiejar(self.cookiejar)196
19 unmodified lines
216 ('location' in r.headers) and217 ((r.status_code is codes.see_other) or (self.allow_redirects))218 ):219220 r.fo.close()220 r.raw.close()221222 if not len(history) < settings.max_redirects:223 raise TooManyRedirects()224
181 unmodified lines
406 #: value of a ``'Content-Encoding'`` response header.407 self.headers = CaseInsensitiveDict()408409 #: File-like object representation of response (for advanced usage).410 self.fo = None410 self.raw = None411412 #: Final URL location of Response.413 self.url = None414
35 unmodified lines
450 'already consumed')451452 def generate():453 while 1:454 chunk = self.fo.read(chunk_size)454 chunk = self.raw.read(chunk_size)455 if not chunk:456 break457 yield chunk458 self._content_consumed = True
19 unmodified lines
478 raise RuntimeError('The content for this response was '479 'already consumed')480481 # Read the contents.482 self._content = self.fo.read()482 self._content = self.raw.read()483484 # Decode GZip'd content.485 if 'gzip' in self.headers.get('content-encoding', ''):486 try:
193 unmodified lines