incubator-libcloud mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ssteiner@idc" <sstei...@integrateddevcorp.com>
Subject Re: [libcloud] Python 2.7 _to_images putheader failure, works on Python 2.6
Date Sun, 18 Jul 2010 12:56:32 GMT
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:
> 
>        headers.update({'Content-Length': str(len(data))})
> 
> Solves the problem.
> 
> S
> 
> On Jul 18, 2010, at 12:25 AM, Tom Davis wrote:
> 
>> 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.
>> 
>> Of course, I reserve the right to be totally off-base here ;)
>> 
>> On Jul 17, 2010, at 9:31 PM, "ssteiner@idc" <ssteiner@integrateddevcorp.com>
wrote:
>> 
>>> With Python 2.7, Rackspace driver
>>> 
>>> Works fine under 2.6.5, fails on Python 2.7
>>> 
>>> Traceback:
>>>  images = self.list_images()
>>> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/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-packages/apache_libcloud-0.4.0-py2.7.egg/libcloud/drivers/rackspace.py",
line 147, in request
>>>  method=method, headers=headers
>>> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/apache_libcloud-0.4.0-py2.7.egg/libcloud/base.py",
line 433, in request
>>>  headers=headers)
>>> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py",
line 946, in request
>>>  self._send_request(method, url, body, headers)
>>> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py",
line 986, in _send_request
>>>  self.putheader(hdr, value)
>>> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py",
line 924, in putheader
>>>  str = '%s: %s' % (header, '\r\n\t'.join(values))
>>> TypeError: sequence item 0: expected string, int found
>>> 
>>> Haven't explored too much, I'm busy on a time-critical deployment, working on
switching to 2.7 to run deployment scripts, fell down right here...
>>> 
>>> Anyone have any ideas?
>>> 
>>> Thanks,
>>> 
>>> Stephen F. Steiner
>>> Integrated Development Corporation
>>> ssteiner@integrateddevcorp.com
>>> www.integrateddevcorp.com
>>> (603)433-1232
>>> 
>>> 
>>> 
> 
> Stephen F. Steiner
> Integrated Development Corporation
> ssteiner@integrateddevcorp.com
> www.integrateddevcorp.com 
> (603)433-1232
> 
> 
> 
> 

Stephen F. Steiner
Integrated Development Corporation
ssteiner@integrateddevcorp.com
www.integrateddevcorp.com 
(603)433-1232





Mime
View raw message