From 41d68c9fdc5035f43e38558ae9973b88e1258f35 Mon Sep 17 00:00:00 2001 From: Shalabh Aggarwal Date: Mon, 22 Jul 2013 20:07:41 +0530 Subject: [PATCH] Make the url a bytestring The URL should be a bytestring rather than a unicode because if its a unicode then the type of msg in httplib _send_output() becomes unicode which in turn tries to concatinate message_body which is a bytestring to msg. Here if the message_body contains a non ascii character, the concatination fails. Hence a URL in bytestring will make sure everything remains a bytestring --- magento/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magento/api.py b/magento/api.py index 3d247fb..13623ab 100644 --- a/magento/api.py +++ b/magento/api.py @@ -109,7 +109,7 @@ def store_views(self): """ assert protocol \ in PROTOCOLS, "protocol must be %s" % ' OR '.join(PROTOCOLS) - self.url = full_url and url or expand_url(url, protocol) + self.url = str(full_url and url or expand_url(url, protocol)) self.username = username self.password = password self.protocol = protocol