some weeks ago I programmed a Python script which posted some content to a Wordpress blog, but since the past week it stopped working (I haven't changed anything) and now when I run the script I get this error:
File "C:\Python27\lib\xmlrpclib.py", line 557, in feed
self._parser.Parse(data, 0)
ExpatError: junk after document element: line 2, column 0
The function I use to post the desired content to Wordpress is this:
post_id = server.wp.newPost(blog_id, user, passw, content)
and it used to work since it started crashing for (apparently) no reason.
¿Do you now what could be the cause of this error?¿Might my Wordpress have been infected (I've checked it)?
Thanks, if you need more code to check something I'll post it, and sorry for my poor English.
Important Edit: I didn't mention that before, but the script works perfect with other wordpress blogs, it only crashes when I try to post to the WP blog I made the script for (that's why I think it the site may be infected).
When the code works the variable data
used in self._parser.Parse(data, 0)
has this content:
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<string>90</string>
</value>
</param>
</params>
</methodResponse>
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<int>90</int>
</value>
</param>
</params>
</methodResponse>
Edit: data variable is used by the library, I don't know what it should contain but debuggin i've found that when the script crashes it has this content:
<br />
<b>Warning</b>: strpos() [<a href='function.strpos'>function.strpos</a>]: Empty delimiter in <b>/PATH/wp-includes/class-wp-xmlrpc-server.php</b> on line <b>3954</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /PATH/wp-includes/class-wp-xmlrpc-server.php:3954) in <b>/PATH/wp-includes/class-IXR.php</b> on line <b>471</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /PATH/wp-includes/class-wp-xmlrpc-server.php:3954) in <b>/PATH/wp-includes/class-IXR.php</b> on line <b>472</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /PATH/wp-includes/class-wp-xmlrpc-server.php:3954) in <b>/ANOTHER_PATH/public_ht
As I said i don't know what should 'data' contain, when the code worked I never checked what it's content was.