Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i have an error with wordpress_xmlrpc on python #41

Open
dido97 opened this issue Nov 14, 2018 · 1 comment
Open

i have an error with wordpress_xmlrpc on python #41

dido97 opened this issue Nov 14, 2018 · 1 comment

Comments

@dido97
Copy link

dido97 commented Nov 14, 2018

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

@richieadler
Copy link

I concur in reporting the same problem.
With more information in the traceback, I get reported the following:

File "C:\Prog\Python37-32\lib\site-packages\wordpress_xmlrpc\base.py", line 24, in init
self.supported_methods = self.server.mt.supportedMethods()
│ │ │ │ └ <xmlrpc.client._Method object at 0x03BBD2B0>
│ │ │ └ <xmlrpc.client._Method object at 0x03BBD870>
│ │ └ <ServerProxy for axxon.com.ar/rev/xmlrpc.php>
│ └ <wordpress_xmlrpc.base.Client object at 0x038F30B0>
└ <wordpress_xmlrpc.base.Client object at 0x038F30B0>
File "C:\Prog\Python37-32\lib\xmlrpc\client.py", line 1112, in call
return self.__send(self.__name, args)
│ │ │ │ └ ()
│ │ │ └ <xmlrpc.client._Method object at 0x03BD5450>
│ │ └ <xmlrpc.client._Method object at 0x03B61230>
│ └ <xmlrpc.client._Method object at 0x03BD5410>
└ <xmlrpc.client._Method object at 0x03B61230>
File "C:\Prog\Python37-32\lib\xmlrpc\client.py", line 1452, in __request
verbose=self.__verbose
│ └ <xmlrpc.client._Method object at 0x03BD5370>
└ <ServerProxy for axxon.com.ar/rev/xmlrpc.php>
File "C:\Prog\Python37-32\lib\xmlrpc\client.py", line 1154, in request
return self.single_request(host, handler, request_body, verbose)
│ │ │ │ │ └ False
│ │ │ │ └ b"\n\nmt.supportedMethods\n\n\n\n"
│ │ │ └ '/rev/xmlrpc.php'
│ │ └ 'axxon.com.ar'
│ └ <bound method Transport.single_request of <xmlrpc.client.Transport object at 0x03B611B0>>
└ <xmlrpc.client.Transport object at 0x03B611B0>
File "C:\Prog\Python37-32\lib\xmlrpc\client.py", line 1170, in single_request
return self.parse_response(resp)
│ │ └ <http.client.HTTPResponse object at 0x03B611D0>
│ └ <bound method Transport.parse_response of <xmlrpc.client.Transport object at 0x03B611B0>>
└ <xmlrpc.client.Transport object at 0x03B611B0>
File "C:\Prog\Python37-32\lib\xmlrpc\client.py", line 1336, in parse_response
p.feed(data)
│ │ └ b'\xef\xbb\xbf\xef\xbb\xbf\n\n \n \n \n ...
│ └ <bound method ExpatParser.feed of <xmlrpc.client.ExpatParser object at 0x03B61430>>
└ <xmlrpc.client.ExpatParser object at 0x03B61430>
File "C:\Prog\Python37-32\lib\xmlrpc\client.py", line 439, in feed
self._parser.Parse(data, 0)
│ │ │ └ b'\xef\xbb\xbf\xef\xbb\xbf\n\n \n \n \n ...
│ │ └ <built-in method Parse of pyexpat.xmlparser object at 0x03B59570>
│ └ <pyexpat.xmlparser object at 0x03B59570>
└ <xmlrpc.client.ExpatParser object at 0x03B61430>

xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 1

In my case I suspect the initial bytes before the <?xml> tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants