]> git.ipfire.org Git - pakfire.git/commitdiff
http: Actually write downloaded file to disk
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Apr 2017 13:53:08 +0000 (15:53 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Apr 2017 13:53:08 +0000 (15:53 +0200)
This was just unreachable code because of wrong indentation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/http.py

index b99c09adf9384bd0bbe96404eacaccef925273cb..be4619320844666c6f989a6ed340fa2e40c4cd12 100644 (file)
@@ -364,9 +364,9 @@ class Client(object):
                                                        # Otherwise raise this error
                                                        raise e
 
-                                               # Downloaded succeeded, writing data to filesystem
-                                               with open(filename, "wb") as output:
-                                                       shutil.copyobj(f, output)
+                                       # Downloaded succeeded, writing data to filesystem
+                                       with open(filename, "wb") as output:
+                                               shutil.copyfileobj(f, output)
 
                finally:
                        # Re-add any skipped mirrors again so that the next