maxcutler / python-wordpress-xmlrpc

Python library for WordPress XML-RPC integration
http://python-wordpress-xmlrpc.rtfd.org
MIT License
382 stars 130 forks source link

help, Is this match wordpress 4.7? #111

Open e10514001 opened 7 years ago

e10514001 commented 7 years ago

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=

<?xml version="1.0" encoding="UTF-8"?>

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
n3storm commented 7 years ago

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.