xmlrpc apis should be less strict?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
b2evolution |
New
|
Medium
|
Unassigned |
Bug Description
In our journey though xmlrpc api clients, I'm testing now blogtk 2.0.
It almost works, but sometimes I gor a error like:
<type 'exceptions.
and this shows on xmlrpc.log:
2009-08-29 00:33:08 metaWeblog.editPost
Invalid signature.
The problem is the field published, in metaWeblog.editPost and metaWeblog.newPost.
a snippet from createPost in blogtk2 createPost:
publish = xmlrpclib.
# Sanitize time for xmlrpc transport if needed.
if content[
if isinstance(
content[
try:
result = rpcServer.
except:
# Some systems want an int instead of a boolean value. We'll assuage their
# craziness for now.
if publish == True:
publish = 1
else:
publish = 0
try:
result = rpcServer.
except Exception, e:
raise Exception, str(e)
In this case, tries create post first with publish as a boolean type, and after as a int type. But the editPost method passes publish = 1, that is casted to int, making our editPost in metaweblog fail.
What we can do is to change the signatures from some methods from something more stritct (like $xmlrpcBoolean) to a ganeric value, (like $xmlrpcValue) and make the checks ourselfs (or send patches to the blogging clients, I'm sending at least bug reports, but I know Python and can easily fix the editPost methods in blogtk2).
What should we do?