2 messages in com.googlegroups.bloggerdevRe: Problems with putrequest method i...
FromSent OnAttachments
juan...@gmail.com01 Feb 2008 12:22 
Jeff Scudder07 Feb 2008 11:35 
Subject:Re: Problems with putrequest method in Python 2.5.1?
From:Jeff Scudder (j.@google.com)
Date:02/07/2008 11:35:59 AM
List:com.googlegroups.bloggerdev

On Feb 1, 12:22 pm, "juan@gmail.com" <juan@gmail.com> wrote:

Hi everyboy,

I'm trying to write a simple command line managing tool for my blogs at blogger. I'm using Python 2.5.1 (Ubuntu 7.10). I have written a very simple function to start with it. The function tries to get the name of the blogs (as in your example code in samples/blogger/ BloggerExample.py) . When I try to execute it, python tells me that:

Traceback (most recent call last): File "./bloggerTool.py", line 75, in <module> main() File "./bloggerTool.py", line 72, in main blogger.printBlogs() File "./bloggerTool.py", line 41, in printBlogs feed = self.blogger_service.Get(query_URI) File "/opt/lib/python/gdata/service.py", line 485, in Get server_response = atom.service.AtomService.Get(self, uri, extra_headers) File "/opt/lib/python/atom/service.py", line 252, in Get url_params, escape_params) File "/opt/lib/python/atom/service.py", line 200, in _CreateConnection connection.putrequest(http_operation, full_uri) File "/usr/lib/python2.5/httplib.py", line 806, in putrequest host_enc = self.host.encode("ascii") AttributeError: 'NoneType' object has no attribute 'encode'

This is my simple function printBlogs: def printBlogs(self): """ print the name of all your blogs in blogger """ query_getBlogs = service.Query() query_getBlogs.feed = "/feeds/default/blogs" query_URI = query_getBlogs.ToUri() feed = self.blogger_service.Get(query_URI) print feed.title.text for title in feed.entry: print title

I'm not sure but I think the problem is in the httplib.py . Do you know what is happening here? Did someout find the same problem?

Oh! BloggerExample.py doesn't work fine too... the same problem :(

Thanks in advance:

Juanjo

What is the full URL which you are Getting? Put another way, what is the server set to in your blogger_service object? Perhaps the string contains characters which are not being correctly converted in the 2.5 version of httplib. Does the sample run in Python2.4?

Thank you,

Jeff