summaryrefslogtreecommitdiffstats
path: root/meta/packages/python/python-urlgrabber/urlgrabber-3.0.0-cleanup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/python/python-urlgrabber/urlgrabber-3.0.0-cleanup.patch')
-rw-r--r--meta/packages/python/python-urlgrabber/urlgrabber-3.0.0-cleanup.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/packages/python/python-urlgrabber/urlgrabber-3.0.0-cleanup.patch b/meta/packages/python/python-urlgrabber/urlgrabber-3.0.0-cleanup.patch
new file mode 100644
index 0000000000..7a1ee059d1
--- /dev/null
+++ b/meta/packages/python/python-urlgrabber/urlgrabber-3.0.0-cleanup.patch
@@ -0,0 +1,28 @@
1diff -up urlgrabber-3.0.0/urlgrabber/grabber.py.cleanup urlgrabber-3.0.0/urlgrabber/grabber.py
2--- urlgrabber-3.0.0/urlgrabber/grabber.py.cleanup 2007-11-29 10:25:13.000000000 +0000
3+++ urlgrabber-3.0.0/urlgrabber/grabber.py 2007-11-29 10:26:15.000000000 +0000
4@@ -1204,16 +1204,18 @@ class URLGrabberFileObject:
5 bs = 1024*8
6 size = 0
7
8- if amount is not None: bs = min(bs, amount - size)
9- block = self.read(bs)
10- size = size + len(block)
11- while block:
12- new_fo.write(block)
13+ try:
14 if amount is not None: bs = min(bs, amount - size)
15 block = self.read(bs)
16 size = size + len(block)
17+ while block:
18+ new_fo.write(block)
19+ if amount is not None: bs = min(bs, amount - size)
20+ block = self.read(bs)
21+ size = size + len(block)
22+ finally:
23+ new_fo.close()
24
25- new_fo.close()
26 try:
27 modified_tuple = self.hdr.getdate_tz('last-modified')
28 modified_stamp = rfc822.mktime_tz(modified_tuple)