diff --git a/HISTORY.rst b/HISTORY.rst index 6bf50f2c..b7831f00 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,6 +6,9 @@ History * Generate chunked ValueError fix * Proxy configuration by environment variables +* Simplification of iter_lines. +* New `trust_env` configuration for disabling system/environment hints. + 0.10.7 (2012-03-07) diff --git a/requests/models.py b/requests/models.py index 0da10ac7..0b4958eb 100644 --- a/requests/models.py +++ b/requests/models.py @@ -704,7 +704,7 @@ class Response(object): return gen - def iter_lines(self, decode_unicode=None): + def iter_lines(self, chunk_size=10 * 1024, decode_unicode=None): """Iterates over the response data, one line at a time. This avoids reading the content at once into memory for large responses. @@ -712,7 +712,9 @@ class Response(object): pending = None - for chunk in self.iter_content(chunk_size=10 * 1024, decode_unicode=decode_unicode): + for chunk in self.iter_content( + chunk_size=chunk_size, + decode_unicode=decode_unicode): if pending is not None: chunk = pending + chunk