[Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0

Michael Wood esiotrot at gmail.com
Wed Feb 27 12:33:39 CET 2013


On 27 February 2013 13:22, azurIt <azurit at pobox.sk> wrote:
>> CC: soap at python.org
>>On 02/27/13 13:00, azurIt wrote:
>>>> CC: soap at python.org
>>>> On 02/27/13 12:46, azurIt wrote:
>>>>>> CC: soap at python.org
>>>>>> On 02/27/13 12:30, azurIt wrote:
>>>>>>> Hm, strange, works also here on 2.6.6 (tried both 32bit and 64bit):
>>>>>> Strange indeed. Michael or Azur, if the below test case is not working
>>>>>> for you, could you help me in isolating what was failing before and how
>>>>>> *actually* my patch fixes it?
>>>>> yes, i will help you but what exaclty do you need? i can still reproduce the problem on most of the servers (didn't patch them yet) on python 2.6.6 (32bit and 64bit).
>>>> well, my stepping through the validation code showed me that
>>>> Decimal('inf') > 6000.0  == False. The patch is to have float('inf') for
>>>> Float and Double types because float('inf') > 6000.0 == True and
>>>> type(6000.0) is float anyway.
>>>>
>>>> When Decimal('inf') > 6000.0 == false, the validate_native() calls
>>>> retuns False, which in turn causes the ValidationError to be raised.
>>>>
>>>> What happens in your case? Why does the validation function return false?
>>>
>>> Can you hint me where exactly you put your tracing code? Thanks.
>>
>>
>>Right here:
>>https://github.com/arskom/spyne/blob/spyne-2.9.3/spyne/protocol/xml/model.py#L76
>
>
> Ok, i probably got it. It's related to -inf in Python 2.6.6:
>
>>>> Decimal('-inf') > 1.0
> True
>>>> Decimal('-inf') > 1
> False

I get the same:

>>> Decimal('-inf') > 1.0
True
>>> Decimal('-inf') > 1
False

-- 
Michael Wood <esiotrot at gmail.com>


More information about the Soap mailing list