maxcutler / python-wordpress-xmlrpc

Python library for WordPress XML-RPC integration

Home Page:http://python-wordpress-xmlrpc.rtfd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

help, Is this match wordpress 4.7?

e10514001 opened this issue · comments

my website is in wordpress 4.7, when i use this code, my code throw exception
code: wp = Client('http://www.xxxx.com/wordpress/xmlrpc.php', 'myname', 'mypass')

exception is this:
File "H:/pythoncode/qiankundanuoyi/test.py", line 43, in
testXMLRPC()
File "H:/pythoncode/qiankundanuoyi/test.py", line 36, in testXMLRPC
wp = Client('http://www.xxxx.com/wordpress/xmlrpc.php', 'myname', 'mypass')
File "build\bdist.win-amd64\egg\wordpress_xmlrpc\base.py", line 24, in init
File "C:\Python27\lib\xmlrpclib.py", line 1240, in call
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1599, in __request
verbose=self.__verbose
File "C:\Python27\lib\xmlrpclib.py", line 1280, in request
return self.single_request(host, handler, request_body, verbose)
File "C:\Python27\lib\xmlrpclib.py", line 1313, in single_request
return self.parse_response(response)
File "C:\Python27\lib\xmlrpclib.py", line 1484, in parse_response
p.feed(data)
File "C:\Python27\lib\xmlrpclib.py", line 558, in feed
self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: junk after document element: line 1, column 84

self._parser.Parse(data, 0), data=

<style>#wp-content-wrap { display:none;} #post-status-info { display:none;}</style> wp.getUsersBlogs wp.newPost wp.editPost wp.deletePost wp.getPost wp.getPosts wp.newTerm wp.editTerm wp.deleteTerm wp.getTerm wp.getTerms wp.getTaxonomy wp.getTaxonomies

We are using this library with WP 4.8 without any issue.
Are you sure your WP is under /wordpress/path?
Looks like your web server is not serving XML response as application/xml content_type.