Return-Path: Delivered-To: apmail-incubator-libcloud-archive@minotaur.apache.org Received: (qmail 68625 invoked from network); 18 Jul 2010 12:57:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Jul 2010 12:57:11 -0000 Received: (qmail 36276 invoked by uid 500); 18 Jul 2010 12:57:10 -0000 Delivered-To: apmail-incubator-libcloud-archive@incubator.apache.org Received: (qmail 36148 invoked by uid 500); 18 Jul 2010 12:57:08 -0000 Mailing-List: contact libcloud-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: libcloud@incubator.apache.org Delivered-To: mailing list libcloud@incubator.apache.org Received: (qmail 36140 invoked by uid 99); 18 Jul 2010 12:57:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Jul 2010 12:57:07 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.200.84.140] (HELO host64.idcwebservices.com) (74.200.84.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Jul 2010 12:57:00 +0000 Received: from c-71-234-137-96.hsd1.nh.comcast.net ([71.234.137.96] helo=[192.168.10.13]) by host64.idcwebservices.com with esmtpa (Exim 4.69) (envelope-from ) id 1OaTQ7-0005FB-Sw; Sun, 18 Jul 2010 08:56:40 -0400 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "ssteiner@idc" In-Reply-To: <35A0AD2E-93B1-4D59-8964-841D97FE189A@integrateddevcorp.com> Date: Sun, 18 Jul 2010 08:56:32 -0400 Cc: libcloud@incubator.apache.org Content-Transfer-Encoding: quoted-printable Message-Id: <39763F01-1E62-4350-A98B-A32E38ECF548@integrateddevcorp.com> References: <8CFE3F57-5C8C-445F-9AFB-90EE8D9F150C@dislocatedday.com> <35A0AD2E-93B1-4D59-8964-841D97FE189A@integrateddevcorp.com> To: ssteiner@idc X-Mailer: Apple Mail (2.1081) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host64.idcwebservices.com X-AntiAbuse: Original Domain - incubator.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - integrateddevcorp.com X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [libcloud] Python 2.7 _to_images putheader failure, works on Python 2.6 And, since I'm busy talking to myself: http://docs.python.org/library/httplib.html "The header Content-Length is automatically set to the correct = value. The headers argument should be a mapping of extra HTTP headers to = send with the request." So setting the header is redundant anyway. S On Jul 18, 2010, at 8:44 AM, ssteiner@idc wrote: > Oh, and if anyone with commit access is listening, changing line 426 = in base.py to: >=20 > headers.update({'Content-Length': str(len(data))}) >=20 > Solves the problem. >=20 > S >=20 > On Jul 18, 2010, at 12:25 AM, Tom Davis wrote: >=20 >> Judging by the exception, I guess they stopped implicitly casting = variables used in format strings? That's not something I remember = reading about in What's New, but it makes sense in that context. What = header we're sending that isn't a string is another question. >>=20 >> Of course, I reserve the right to be totally off-base here ;) >>=20 >> On Jul 17, 2010, at 9:31 PM, "ssteiner@idc" = wrote: >>=20 >>> With Python 2.7, Rackspace driver >>>=20 >>> Works fine under 2.6.5, fails on Python 2.7 >>>=20 >>> Traceback: >>> images =3D self.list_images() >>> File = "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pack= ages/apache_libcloud-0.4.0-py2.7.egg/libcloud/drivers/rackspace.py", = line 193, in list_images >>> return = self._to_images(self.connection.request('/images/detail').object) >>> File = "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pack= ages/apache_libcloud-0.4.0-py2.7.egg/libcloud/drivers/rackspace.py", = line 147, in request >>> method=3Dmethod, headers=3Dheaders >>> File = "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pack= ages/apache_libcloud-0.4.0-py2.7.egg/libcloud/base.py", line 433, in = request >>> headers=3Dheaders) >>> File = "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.p= y", line 946, in request >>> self._send_request(method, url, body, headers) >>> File = "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.p= y", line 986, in _send_request >>> self.putheader(hdr, value) >>> File = "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.p= y", line 924, in putheader >>> str =3D '%s: %s' % (header, '\r\n\t'.join(values)) >>> TypeError: sequence item 0: expected string, int found >>>=20 >>> Haven't explored too much, I'm busy on a time-critical deployment, = working on switching to 2.=107 to run deployment scripts, fell down = right here... >>>=20 >>> Anyone have any ideas? >>>=20 >>> Thanks, >>>=20 >>> Stephen F. Steiner >>> Integrated Development Corporation >>> ssteiner@integrateddevcorp.com >>> www.integrateddevcorp.com >>> (603)433-1232 >>>=20 >>>=20 >>>=20 >=20 > Stephen F. Steiner > Integrated Development Corporation > ssteiner@integrateddevcorp.com > www.integrateddevcorp.com=20 > (603)433-1232 >=20 >=20 >=20 >=20 Stephen F. Steiner Integrated Development Corporation ssteiner@integrateddevcorp.com www.integrateddevcorp.com=20 (603)433-1232