Menu

#9 ZSI: false -> in Boolean.serialize()

closed-invalid
nobody
None
5
2003-10-29
2002-07-21
Anonymous
No

As I understand the documentation 'false' should
serialize to 0.
Currently only values that evaluate to 0 do so. This
patch causes
'false' (case-insensitive) to be recognized.

--- TC.py.dist Sun Jul 21 14:41:02 2002
+++ TC.py Sun Jul 21 14:39:25 2002
@@ -726,7 +726,10 @@
tstr = ' xsi:type="xsd:boolean"'
else:
tstr = ''
- pyobj = (pyobj and 1) or 0
+ try:
+ pyobj = pyobj.lower() != 'false' and 1 or 0
+ except:
+ pyobj = (pyobj and 1) or 0
print >>sw, '<%s%s%s>%d</%s>' % \ (n, kw.get('attrtext', ''), tstr, pyobj, n)

Henk Hesselink

Discussion

  • Keith Jackson

    Keith Jackson - 2003-10-29
    • status: open --> closed
     
  • Keith Jackson

    Keith Jackson - 2003-10-29
    • status: closed --> closed-invalid
     
  • Keith Jackson

    Keith Jackson - 2003-10-29

    Logged In: YES
    user_id=711889

    I don't think the string 'false' should serialize as a boolean.

     

Log in to post a comment.