glasserc / rst2wp

Post to Wordpress using ReStructuredText
11 stars 10 forks source link

httplib.IncompleteRead: IncompleteRead #13

Open mgazzin opened 10 years ago

mgazzin commented 10 years ago

Hi,

nice software. Unfortunately I am getting the following error:

[root@inspiron rst2wp]# rst2wp --list-tags
loading config from /root/.config/rst2wp/wordpressrc
config loaded
Connecting to WP server at http://mgazzinblog.altervista.org/blog/xmlrpc.php
Traceback (most recent call last):
  File "/usr/local/bin/rst2wp", line 9, in <module>
    load_entry_point('rst2wp==0.1.0', 'console_scripts', 'rst2wp')()
  File "/usr/local/lib/python2.7/site-packages/rst2wp-0.1.0-py2.7.egg/rst2wp/rst2wp.py", line 593, in main
    Rst2Wp().run()
  File "/usr/local/lib/python2.7/site-packages/rst2wp-0.1.0-py2.7.egg/rst2wp/rst2wp.py", line 416, in run
    self.wp = wp = self.create_client(url, username, password)
  File "/usr/local/lib/python2.7/site-packages/rst2wp-0.1.0-py2.7.egg/rst2wp/rst2wp.py", line 391, in create_client
    blogs = list(wp.get_users_blogs())
  File "/usr/local/lib/python2.7/site-packages/rst2wp-0.1.0-py2.7.egg/rst2wp/lib/wordpresslib.py", line 351, in getUsersBlogs
    blogs = self._server.blogger.getUsersBlogs('', self.user, self.password)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1453, in parse_response
    stream = GzipDecodedResponse(response)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1204, in __init__
    self.stringio = StringIO.StringIO(response.read())
  File "/usr/local/lib/python2.7/httplib.py", line 551, in read
    s = self._safe_read(self.length)
  File "/usr/local/lib/python2.7/httplib.py", line 660, in _safe_read
    raise IncompleteRead(''.join(s), amt)
httplib.IncompleteRead: IncompleteRead(286 bytes read, 406 more expected)

but I've test my site with http://xmlrpc.eritreo.it/ and it looks ok. Do you have an idea of what it is happening?

Thank a lot.

Marco

glasserc commented 10 years ago

Hi Marco, unfortunately I have no idea what's going on. It looks like httplib is requesting the page be gzip-compressed. Maybe that is why the eritreo.it tool isn't seeing the failure. It looks like httplib was given a content-length, but the response is shorter than that content-length. Can you check your blog's error log and see if anything shows up? It might be possible to hack your copy of wordpresslib to not request gzip-compressed pages and see if that changes anything.