From 43bda84362b8fd8bb74a81003e8b49cff15ea5ed Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Mon, 12 Mar 2012 11:25:04 -0700 Subject: [PATCH] Avoid missing content-length header in project.py Occassionally, the content-length may be missing when using urlib in python 2.6 and 2.7. This change assumes the value of the header is 0 if it doesn't exist Change-Id: Iaf1c8a796bc667823d4d7c30f9b617644b271d00 --- project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.py b/project.py index f48472b4..f1a931c6 100644 --- a/project.py +++ b/project.py @@ -1529,7 +1529,7 @@ class Project(object): p = None try: - size = r.headers['content-length'] + size = r.headers.get('content-length', 0) unit = 1 << 10 if size and not quiet: