What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
A return value (Boolean-Type) of an XML-RPC-Call from AS3 to Python is
supposed to be decoded as Boolean-Values true or false.
In my case any Boolean-Value was decoded as true.
The problem seems to be the statement "return Boolean(robject.boolean);" in
XMLRPCSerializer.decodeObject().
I did a test in AS3:
trace(new Boolean("1")) returns true
trace(new Boolean("0")) returns true, but I expect to return false.
What version of the product are you using? On what operating system?
WinXP, AIR beta 2, Python2.5
Please provide any additional information below.
Here are my work-a-rounds, but actually I would prefere not to edit
provided source codes.
Class: XMLRPCSerializer
private static function decodeObject (robject:*):*
{
if (robject.children().name() == TYPE_STRING)
{
...
else if (robject.children().name() == TYPE_BOOLEAN)
{
//original code:
//return Boolean(robject.boolean);
//Problem:
//trace(new Boolean("0"))-->true
//trace(new Boolean("1"))-->true
//Workarounds:
//Version 1:
return Boolean(Number(robject.boolean));
//Version2:
//if (robject.boolean=="1") {return true;}
//if (robject.boolean=="true") {return true;}
//if (robject.boolean=="True") {return true;}
//if (robject.boolean=="0") {return false;}
//if (robject.boolean=="false") {return false;}
//if (robject.boolean=="False") {return false;}
}
else if (robject.children().name()== TYPE_DATE)
{
...
Original issue reported on code.google.com by bastma...@gmail.com on 5 Dec 2007 at 12:31
Original issue reported on code.google.com by
bastma...@gmail.com
on 5 Dec 2007 at 12:31