2

I am using the followng wordpress xmlrpc module written in python:

But when I run the program I get the following error.You have any idea of how to solve this program??Here is the error that I get

Traceback (most recent call last):
  File "<pyshell#28>", line 1, in <module>
    wp.call(NewPost(post, True))
  File "C:\Python27\lib\site-packages\wordpress_xmlrpc\base.py", line 27, in call
    raw_result = server_method(*args)
  File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "C:\Python27\lib\xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "C:\Python27\lib\xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "C:\Python27\lib\xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "C:\Python27\lib\xmlrpclib.py", line 1467, in parse_response
    p.feed(data)
  File "C:\Python27\lib\xmlrpclib.py", line 557, in feed
    self._parser.Parse(data, 0)
ExpatError: junk after document element: line 2, column 0
2
  • It'd help if you provided the call that produces this exception... Commented Jun 30, 2012 at 7:15
  • uh... self._parser.Parse(data, 0) Commented Jun 30, 2012 at 8:01

1 Answer 1

2

This error usually occurs when the response to your call is not valid XML. For example, if it begins with a newline, like this:

\n<?xml version="1.0"?>\n<methodResponse>\n<params>\n<param>\n<value>\n
<array><data>\n  <value><string>wp.getUsersBlogs</string></value>

Some versions of WordPress (or some installed plugins) seem to have this issue. Unfortunately, that means the issue is not in your code but with the WordPress instance you are communicating with.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.