From f5068056fc9da3c550bc81d1769823027b848bc4 Mon Sep 17 00:00:00 2001 From: "A. Murat Eren" Date: Tue, 20 Sep 2005 11:49:52 +0000 Subject: [PATCH] sacma sapan konfigurasyonu olan sunucularla da calisabilelim.. --- pisi/fetcher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pisi/fetcher.py b/pisi/fetcher.py index cf17649e..6519238a 100644 --- a/pisi/fetcher.py +++ b/pisi/fetcher.py @@ -134,9 +134,10 @@ class Fetcher: except HTTPException, e: self.err(('(%s): %s') % (e.__class__.__name__, e)) - if headers and not headers.has_key('Content-Length'): - totalsize = 0 # could not get the totalsize of file - else: totalsize = int(headers['Content-Length']) + try: + totalsize = int(headers['Content-Length']) + except: + totalsize = 0 dest = open(os.path.join(self.filedest, self.url.filename()) , "w") self._do_grab(fileObj, dest, totalsize)