From 4a829bcfb45d6c860fffc658738065c2c4f106c9 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh <bryan.tongminh@gmail.com> Date: Fri, 6 May 2011 13:14:10 +0000 Subject: [PATCH] Explicitly convert Content-Length to string --- mwclient/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mwclient/http.py b/mwclient/http.py index 8cc8507..0a927a4 100644 --- a/mwclient/http.py +++ b/mwclient/http.py @@ -84,9 +84,9 @@ class HTTPPersistentConnection(object): headers['Cookie'] = self.cookies[host].get_cookie_header() if issubclass(data.__class__, upload.Upload): headers['Content-Type'] = data.content_type - headers['Content-Length'] = data.length; + headers['Content-Length'] = str(data.length) elif data: - headers['Content-Length'] = len(data) + headers['Content-Length'] = str(len(data)) if _headers: headers.update(_headers) -- GitLab