From 6b22e2ec29c48b23e3bf4d15220fe9726a2cf651 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 22 May 2024 08:21:01 +0200 Subject: [PATCH] use request.iter_content --- ox/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ox/api.py b/ox/api.py index 6488a2a..85919d1 100644 --- a/ox/api.py +++ b/ox/api.py @@ -126,7 +126,7 @@ class API(object): tmpname = filename + '.tmp' with open(tmpname, 'wb') as fd: r = self._requests_session.get(url) - for chunk in iter(lambda: r.read(chunk_size), b''): + for chunk in r.iter_content(chunk_size=chunk_size): fd.write(chunk) shutil.move(tmpname, filename)