maxcutler / python-wordpress-xmlrpc

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

i have an error with wordpress_xmlrpc on python #123

Closed dido97 closed 5 years ago

dido97 commented 5 years ago

i have an error with wordpress_xmlrpc on python

from wordpress_xmlrpc import Client, WordPressPost from wordpress_xmlrpc.methods.posts import GetPosts, NewPost

from wordpress_xmlrpc.methods.users import GetUserInfo

wp = Client('http://mysite.wordpress.com/xmlrpc.php', 'username', 'password') Traceback (most recent call last): File "<pyshell#3>", line 1, in wp = Client('http://mysite.wordpress.com/xmlrpc.php', 'username', 'pasword') File "C:\Users\username\AppData\Local\Programs\Python\Python37\lib\site-packages\wordpress_xmlrpc\base.py", line 24, in init self.supported_methods = self.server.mt.supportedMethods() File "C:\Users\username\AppData\Local\Programs\Python\Python37\lib\xmlrpc\client.py", line 1112, in call return self.send(self.name, args) File "C:\Users\username\AppData\Local\Programs\Python\Python37\lib\xmlrpc\client.py", line 1452, in request verbose=self.verbose File "C:\Users\username\AppData\Local\Programs\Python\Python37\lib\xmlrpc\client.py", line 1154, in request return self.single_request(host, handler, request_body, verbose) File "C:\Users\username\AppData\Local\Programs\Python\Python37\lib\xmlrpc\client.py", line 1170, in single_request return self.parse_response(resp) File "C:\Users\username\AppData\Local\Programs\Python\Python37\lib\xmlrpc\client.py", line 1336, in parse_response p.feed(data) File "C:\Users\username\AppData\Local\Programs\Python\Python37\lib\xmlrpc\client.py", line 439, in feed self._parser.Parse(data, 0) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 222

maxcutler commented 5 years ago

That usually means that your server is returning a PHP error at the top of the response, making it an invalid XML document.

dido97 commented 5 years ago

how can i fix that ? i tried on two websites

alexdarling commented 5 years ago

Since this is specific to your websites, you're probably stuck with the normal WordPress troubleshooting methods.

  1. Disable your plugins and swap to a default theme, then try to connect again.
  2. If it works then, reenable the theme & check again.
  3. If it still works, reenable 1 plugin & check again.
  4. Repeat step 3 for all of your plugins.

At some point, you should get the error. That will let you figure out what's wrong with the API both of your websites.

dido97 commented 5 years ago

but in this tutorials https://python-wordpress-xmlrpc.readthedocs.io/en/latest/overview.html it says i need XML-RPC Modernization Plugin.

dido97 commented 5 years ago

i tried to deactivate all plugins but the same error

alexdarling commented 5 years ago

In the interest of not spamming the other people watching this repo, I think it would be wiser to move this conversation over to your StackOverflow post. I've replied to you with a few questions over there.

dido97 commented 5 years ago

ok i will continue from stackoverflow