From burak.arslan at arskom.com.tr Fri Feb 1 14:34:34 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 01 Feb 2013 15:34:34 +0200 Subject: [Soap-Python] stack overflow Message-ID: <510BC46A.5000104@arskom.com.tr> All, FYI, I'm now subscribed to the questions on stackoverflow tagged 'spyne'. You can ask questions there as well, if you find that site more convenient. Spyne's web site is also updated with a link to the stackoverlow page: http://spyne.io Best Regards, Burak From nathan at linkpos.com Sat Feb 16 04:51:01 2013 From: nathan at linkpos.com (nathan at linkpos.com) Date: Fri, 15 Feb 2013 20:51:01 -0700 Subject: [Soap-Python] How to change the type-names of arrays in spyne Message-ID: <251cff2ca60a0d8a7fff7368c69b315e.squirrel@mail.linkpos.com> I am hoping that someone can help me figure out how to solve a problem that I am having with Spyne.? My sever code is responding with the right content , but seems to force all array-type results to be titled "Array".? Unfortunately the client that I am trying to server require the arrays to be titled "ArrayOf".? I have tried everything I can think of to override this behavior, but have not found a way to change this.? Does anyone have an example of creating and Iterable, or Array as part of the response where the name is changed to something else? Here is an example of the response of my Spyne server: (TicketListResult){ ?? success = True ?? Tickets = ????? (TicketListingArray){ <--Note the automatic suffix "Array" here ???????? TicketListing[] = ??????????? (TicketListing){ ?????????????? ticketID = 23 ?????????????? ticketNumber = "20130113104411028" ?????????????? register = "1" ?????????????? employeeName = "CEO Robert" ?????????????? table = 1 ??????????? }, ??????????? (TicketListing){ ?????????????? ticketID = 24 ?????????????? ticketNumber = "20130113105111029" ?????????????? register = "1" ?????????????? employeeName = "CEO Robert" ?????????????? table = 1 ??????????? }, ????? } ?} ? This is how I need it to look to satisfy the client code: (TicketListResult){ ?? success = True ?? Tickets = ????? (ArrayOfTicketListing){ <--Note the prefix "ArrayOf" here ???????? TicketListing[] = ??????????? (TicketListing){ ?????????????? ticketID = 23 ?????????????? ticketNumber = "20130113104411028" ?????????????? register = "1" ?????????????? employeeName = "CEO Robert" ?????????????? table = 1 ??????????? }, ??????????? (TicketListing){ ?????????????? ticketID = 24 ?????????????? ticketNumber = "20130113105111029" ?????????????? register = "1" ?????????????? employeeName = "CEO Robert" ?????????????? table = 1 ??????????? }, ????? } ?} Thank you for any helpful example in advance. -Nathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Sat Feb 16 15:11:08 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sat, 16 Feb 2013 16:11:08 +0200 Subject: [Soap-Python] How to change the type-names of arrays in spyne In-Reply-To: <251cff2ca60a0d8a7fff7368c69b315e.squirrel@mail.linkpos.com> References: <251cff2ca60a0d8a7fff7368c69b315e.squirrel@mail.linkpos.com> Message-ID: <511F937C.1090607@arskom.com.tr> On 02/16/13 05:51, nathan at linkpos.com wrote: > > Does anyone have an example of creating and Iterable, or Array as part > of the response where the name is changed to something else? > Hi Nathan, Normally, Array(String, type_name='ArrayOfString') should work, but it doesn't. I've fixed this in the trunk and the fix will ship in 2.10.0. As a workaround, you can do this: ArrayOfTicketList = Array(TicketList) ArrayOfTicketList.__type_name__ = 'ArrayOfTicketList' ... and use ArrayOfTicketList in class and function definitions instead. Does that help? Best regards, Burak From nathan at linkpos.com Sat Feb 16 20:26:33 2013 From: nathan at linkpos.com (nathan at linkpos.com) Date: Sat, 16 Feb 2013 12:26:33 -0700 Subject: [Soap-Python] How to change the type-names of arrays in spyne In-Reply-To: <511F937C.1090607@arskom.com.tr> References: <251cff2ca60a0d8a7fff7368c69b315e.squirrel@mail.linkpos.com> <511F937C.1090607@arskom.com.tr> Message-ID: <614fbe967204f390c0e81b50bedecd5b.squirrel@mail.linkpos.com> Thank you very much for your quick response.? Spyne is a great tool and I appreciate you putting it together.? Unfortunately, I think there must be something fundamentally wrong with the way I am using Spyne with Arrays and lists.? I was not able to get your suggestions to work.? So I upgraded to 2.10.0-py2.7 to see if the orginal syntax would work in 2.10, but that didn't make a difference either.? I am trying to replace a soap server interface that already exists, and the clients I have are particular about the names used. So I have created a cut-down version of my server with a suds-type client script (at the top) which I hope will help to show you what I am seeing.? I am sorry to do this for two reasons:? First, it will show how little I know about python/spyne, and second it is not usually fun to read through other people's code. Problem 1 (See line 83):? I do not understand the "Array" paradigm.? In all the examples I looked through class members are declared like this 'some_member = Array( Thing)'? but then in the function definition they just assign 'x.some_member = [ a1, b2, c3 ]' because this works (except for the name issue Array).? To me it seems like I should be able to have a member declared as an Array and then in the function definition I should just be able to 'append' to that member.? This is probalby because I think of Arrays as python lists-- and they clearly are not. Problem 2 (See line 108): I can not find a work around that affects the type-name seen by the clients. I am sorry for the bother, but thank you for your patience and assitance.? I think there something significant I am missing, but hopefully it is some little thing. -Nathan > On 02/16/13 05:51, nathan at linkpos.com wrote: >> >> Does anyone have an example of creating and Iterable, or Array as part >> of the response where the name is changed to something else? >> > > Hi Nathan, > > Normally, Array(String, type_name='ArrayOfString') should work, but it > doesn't. I've fixed this in the trunk and the fix will ship in 2.10.0. > > As a workaround, you can do this: > > ArrayOfTicketList = Array(TicketList) > ArrayOfTicketList.__type_name__ = 'ArrayOfTicketList' > > ... and use ArrayOfTicketList in class and function definitions instead. > > Does that help? > > Best regards, > Burak > > > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: simple_agent.py Type: text/x-python Size: 4018 bytes Desc: not available URL: From burakarslan at sabanciuniv.edu Sun Feb 17 14:19:15 2013 From: burakarslan at sabanciuniv.edu (Burak Arslan) Date: Sun, 17 Feb 2013 15:19:15 +0200 Subject: [Soap-Python] How to change the type-names of arrays in spyne In-Reply-To: <614fbe967204f390c0e81b50bedecd5b.squirrel@mail.linkpos.com> References: <251cff2ca60a0d8a7fff7368c69b315e.squirrel@mail.linkpos.com> <511F937C.1090607@arskom.com.tr> <614fbe967204f390c0e81b50bedecd5b.squirrel@mail.linkpos.com> Message-ID: <5120D8D3.9040803@sabanciuniv.edu> Hi Nathan, The issue was that you did not instantiate your classes. Names from the spyne.model package are there just for the shows -- they're type markers and don't actually do much serialization, if at all. The following Spyne class: class SomeObject(ComplexModel): a=Integer b=String c=Array(Double) ... is "equivalent" to the following C++ code: struct SomeObject { int a; string b; vector c; } So in order to use Spyne classes, you need to instantiate them, just like you would instantiate a C++ class. I realize that declaring classes like this is not the most pythonic way, but I firmly believe that "static typing (with declarative constraints) works wonders when your data comes from untrusted sources". Spyne is the result of my being stubborn about this opinion :) I chose to abuse Python's class attributes to make the class declaration as eye-pleasing as possible, but I admit that sometimes it comes off as a little bit weird at first. Hopefully it's a fair trade-off. So anyway, please have a look at the following gist to see my changes to your code to make it work. https://gist.github.com/plq/4970712 Please let me know if you have further questions. By the way, if you do want to help, blog posts about your Spyne experience or pull requests for the documentation are highly appreciated. I try to do my best with the documentation, but first timers documenting their Spyne experience is very valuable and something I can't really do. Thanks and best regards, Burak On 16/02/13 21:26, nathan at linkpos.com wrote: > > Thank you very much for your quick response. Spyne is a great tool > and I appreciate you putting it together. Unfortunately, I think > there must be something fundamentally wrong with the way I am using > Spyne with Arrays and lists. I was not able to get your suggestions > to work. So I upgraded to 2.10.0-py2.7 to see if the orginal syntax > would work in 2.10, but that didn't make a difference either. > > I am trying to replace a soap server interface that already exists, > and the clients I have are particular about the names used. > > So I have created a cut-down version of my server with a suds-type > client script (at the top) which I hope will help to show you what I > am seeing. I am sorry to do this for two reasons: First, it will > show how little I know about python/spyne, and second it is not > usually fun to read through other people's code. > > Problem 1 (See line 83): I do not understand the "Array" paradigm. > In all the examples I looked through class members are declared like > this 'some_member = Array( Thing)' but then in the function > definition they just assign 'x.some_member = [ a1, b2, c3 ]' because > this works (except for the name issue Array). To me it seems > like I should be able to have a member declared as an Array and then > in the function definition I should just be able to 'append' to that > member. This is probalby because I think of Arrays as python lists-- > and they clearly are not. > > Problem 2 (See line 108): I can not find a work around that affects > the type-name seen by the clients. > > I am sorry for the bother, but thank you for your patience and > assitance. I think there something significant I am missing, but > hopefully it is some little thing. > > -Nathan > > > On 02/16/13 05:51, nathan at linkpos.com wrote: > >> > >> Does anyone have an example of creating and Iterable, or Array as part > >> of the response where the name is changed to something else? > >> > > > > Hi Nathan, > > > > Normally, Array(String, type_name='ArrayOfString') should work, but it > > doesn't. I've fixed this in the trunk and the fix will ship in 2.10.0. > > > > As a workaround, you can do this: > > > > ArrayOfTicketList = Array(TicketList) > > ArrayOfTicketList.__type_name__ = 'ArrayOfTicketList' > > > > ... and use ArrayOfTicketList in class and function definitions instead. > > > > Does that help? > > > > Best regards, > > Burak > > > > > > _______________________________________________ > > Soap mailing list > > Soap at python.org > > http://mail.python.org/mailman/listinfo/soap > > > From nicole.haenni at gmail.com Mon Feb 18 04:44:46 2013 From: nicole.haenni at gmail.com (Nicole Haenni) Date: Mon, 18 Feb 2013 04:44:46 +0100 Subject: [Soap-Python] Survey for framework and library developers: "Information needs in software ecosystems" In-Reply-To: References: Message-ID: I?m Nicole Haenni and I'm doing research for my thesis at the University of Berne (scg.unibe.ch) with Mircea Lungu and Niko Schwarz. We are researching on monitoring the activity in software ecosystems. This is a study about information needs that arise in such software ecosystems. I need your help to fill out the survey below. It takes about 10 minutes to complete it. A software ecosystem can be a project repository like GitHub, an open source community (e.g. the Apache community) or a language-based community (e.g. Smalltalk has Squeaksource, Ruby has Rubyforge). We formulate our research question as follows: "What information needs arise when developers use code from other projects, or see their own code used elsewhere." Survey link: http://bit.ly/14Zc71N or original link: https://docs.google.com/spreadsheet/viewform?formkey=dFBJUmVodVU1V3BMMGRPRWxBdjdDbVE6MA Thank you for your support! Nicole -------------- next part -------------- An HTML attachment was scrubbed... URL: From azurit at pobox.sk Mon Feb 25 15:00:14 2013 From: azurit at pobox.sk (azurIt) Date: Mon, 25 Feb 2013 15:00:14 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= Message-ID: <20130225150014.71B90383@pobox.sk> Hi, i'm having problems with spyne 2.9.3 and lxml 3.1.0. When i try to use Integer or Float as an parameter to function, this error is printed: Traceback (most recent call last): File "client.py", line 4, in result = client.service.test(6000.0) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 542, in __call__ return client.invoke(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke result = self.send(soapenv) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 649, in send result = self.failed(binding, e) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 702, in failed r, p = binding.get_fault(reply) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/bindings/binding.py", line 265, in get_fault raise WebFault(p, faultroot) suds.WebFault: Server raised fault: 'The value "'6000.0'" could not be validated.' Everything works with these configurations: rpclib 2.7.0 + lxml 3.1.0 spyne 2.9.3 + lxml 2.3.2 rpclib 2.7.0 + lxml 2.3.3 Any ideas? Thnx. azur From burak.arslan at arskom.com.tr Tue Feb 26 09:56:17 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 26 Feb 2013 10:56:17 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130225150014.71B90383@pobox.sk> References: <20130225150014.71B90383@pobox.sk> Message-ID: <512C78B1.6030003@arskom.com.tr> Hi Azur, That's the suds traceback. What does the traceback from the spyne side say? Best, Burak On 02/25/13 16:00, azurIt wrote: > Hi, > > i'm having problems with spyne 2.9.3 and lxml 3.1.0. When i try to use Integer or Float as an parameter to function, this error is printed: > > Traceback (most recent call last): > File "client.py", line 4, in > result = client.service.test(6000.0) > File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 542, in __call__ > return client.invoke(args, kwargs) > File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke > result = self.send(soapenv) > File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 649, in send > result = self.failed(binding, e) > File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 702, in failed > r, p = binding.get_fault(reply) > File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/bindings/binding.py", line 265, in get_fault > raise WebFault(p, faultroot) > suds.WebFault: Server raised fault: 'The value "'6000.0'" could not be validated.' > > Everything works with these configurations: > rpclib 2.7.0 + lxml 3.1.0 > spyne 2.9.3 + lxml 2.3.2 > rpclib 2.7.0 + lxml 2.3.3 > > > Any ideas? Thnx. > > azur > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Tue Feb 26 10:44:43 2013 From: azurit at pobox.sk (azurIt) Date: Tue, 26 Feb 2013 10:44:43 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512C78B1.6030003@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk> <512C78B1.6030003@arskom.com.tr> Message-ID: <20130226104443.5A62F102@pobox.sk> Sorry, here it is: Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/server/_base.py", line 82, in get_in_object message=self.app.in_protocol.REQUEST) File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/soap/soap11.py", line 252, in deserialize ctx.in_object = self.from_element(body_class, ctx.in_body_doc) File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/_base.py", line 161, in from_element return handler(self, cls, element) File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 64, in wrapper return func(prot, cls, element) File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 234, in complex_from_element value = prot.from_element(member, c) File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/_base.py", line 161, in from_element return handler(self, cls, element) File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 64, in wrapper return func(prot, cls, element) File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 79, in base_from_element raise ValidationError(element.text) ValidationError: Fault(Client.ValidationError: 'The value "\'6000.0\'" could not be validated.') ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 26.02.2013 09:56 > Predmet: Re: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 > > CC: soap at python.org >Hi Azur, > >That's the suds traceback. What does the traceback from the spyne side say? > >Best, >Burak > > > >On 02/25/13 16:00, azurIt wrote: >> Hi, >> >> i'm having problems with spyne 2.9.3 and lxml 3.1.0. When i try to use Integer or Float as an parameter to function, this error is printed: >> >> Traceback (most recent call last): >> File "client.py", line 4, in >> result = client.service.test(6000.0) >> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 542, in __call__ >> return client.invoke(args, kwargs) >> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke >> result = self.send(soapenv) >> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 649, in send >> result = self.failed(binding, e) >> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 702, in failed >> r, p = binding.get_fault(reply) >> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/bindings/binding.py", line 265, in get_fault >> raise WebFault(p, faultroot) >> suds.WebFault: Server raised fault: 'The value "'6000.0'" could not be validated.' >> >> Everything works with these configurations: >> rpclib 2.7.0 + lxml 3.1.0 >> spyne 2.9.3 + lxml 2.3.2 >> rpclib 2.7.0 + lxml 2.3.3 >> >> >> Any ideas? Thnx. >> >> azur >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From burak.arslan at arskom.com.tr Tue Feb 26 11:10:31 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 26 Feb 2013 12:10:31 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130226104443.5A62F102@pobox.sk> References: <20130225150014.71B90383@pobox.sk> <512C78B1.6030003@arskom.com.tr> <20130226104443.5A62F102@pobox.sk> Message-ID: <512C8A17.3060105@arskom.com.tr> Hi Azur, At first glance, this doesn't make sense. Here's where it fails: https://github.com/arskom/spyne/blob/spyne-2.9.3/spyne/protocol/xml/model.py#L79 validate_native() calls are for enforcing constraints. It's very simple, see here: https://github.com/arskom/spyne/blob/spyne-2.9.3/spyne/model/primitive.py#L356 Are you sure the value 6000.0 is not outside the defined range? You said you used Integer or Float as parameters. What are the vaues for Integer.Attributes.{gt,ge,lt,le} ? Best, Burak On 02/26/13 11:44, azurIt wrote: > Sorry, here it is: > > > Traceback (most recent call last): > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/server/_base.py", line 82, in get_in_object > message=self.app.in_protocol.REQUEST) > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/soap/soap11.py", line 252, in deserialize > ctx.in_object = self.from_element(body_class, ctx.in_body_doc) > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/_base.py", line 161, in from_element > return handler(self, cls, element) > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 64, in wrapper > return func(prot, cls, element) > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 234, in complex_from_element > value = prot.from_element(member, c) > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/_base.py", line 161, in from_element > return handler(self, cls, element) > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 64, in wrapper > return func(prot, cls, element) > File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 79, in base_from_element > raise ValidationError(element.text) > ValidationError: Fault(Client.ValidationError: 'The value "\'6000.0\'" could not be validated.') > > > > > > ______________________________________________________________ >> Od: "Burak Arslan" >> Komu: azurIt >> D?tum: 26.02.2013 09:56 >> Predmet: Re: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 >> >> CC: soap at python.org >> Hi Azur, >> >> That's the suds traceback. What does the traceback from the spyne side say? >> >> Best, >> Burak >> >> >> >> On 02/25/13 16:00, azurIt wrote: >>> Hi, >>> >>> i'm having problems with spyne 2.9.3 and lxml 3.1.0. When i try to use Integer or Float as an parameter to function, this error is printed: >>> >>> Traceback (most recent call last): >>> File "client.py", line 4, in >>> result = client.service.test(6000.0) >>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 542, in __call__ >>> return client.invoke(args, kwargs) >>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke >>> result = self.send(soapenv) >>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 649, in send >>> result = self.failed(binding, e) >>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 702, in failed >>> r, p = binding.get_fault(reply) >>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/bindings/binding.py", line 265, in get_fault >>> raise WebFault(p, faultroot) >>> suds.WebFault: Server raised fault: 'The value "'6000.0'" could not be validated.' >>> >>> Everything works with these configurations: >>> rpclib 2.7.0 + lxml 3.1.0 >>> spyne 2.9.3 + lxml 2.3.2 >>> rpclib 2.7.0 + lxml 2.3.3 >>> >>> >>> Any ideas? Thnx. >>> >>> azur >>> _______________________________________________ >>> Soap mailing list >>> Soap at python.org >>> http://mail.python.org/mailman/listinfo/soap >> From azurit at pobox.sk Tue Feb 26 11:21:38 2013 From: azurit at pobox.sk (azurIt) Date: Tue, 26 Feb 2013 11:21:38 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512C8A17.3060105@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk> <512C8A17.3060105@arskom.com.tr> Message-ID: <20130226112138.4C5E7A4D@pobox.sk> Server: http://pastebin.com/Njhbf4SM Client: http://pastebin.com/6NCMHFpN run server with spyne 2.9.3 and lxml 3.1.0 ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 26.02.2013 11:10 > Predmet: Re: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 > > CC: soap at python.org >Hi Azur, > >At first glance, this doesn't make sense. > >Here's where it fails: >https://github.com/arskom/spyne/blob/spyne-2.9.3/spyne/protocol/xml/model.py#L79 > >validate_native() calls are for enforcing constraints. It's very simple, >see here: > >https://github.com/arskom/spyne/blob/spyne-2.9.3/spyne/model/primitive.py#L356 > >Are you sure the value 6000.0 is not outside the defined range? > >You said you used Integer or Float as parameters. What are the vaues for >Integer.Attributes.{gt,ge,lt,le} ? > >Best, >Burak > >On 02/26/13 11:44, azurIt wrote: >> Sorry, here it is: >> >> >> Traceback (most recent call last): >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/server/_base.py", line 82, in get_in_object >> message=self.app.in_protocol.REQUEST) >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/soap/soap11.py", line 252, in deserialize >> ctx.in_object = self.from_element(body_class, ctx.in_body_doc) >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/_base.py", line 161, in from_element >> return handler(self, cls, element) >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 64, in wrapper >> return func(prot, cls, element) >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 234, in complex_from_element >> value = prot.from_element(member, c) >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/_base.py", line 161, in from_element >> return handler(self, cls, element) >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 64, in wrapper >> return func(prot, cls, element) >> File "/usr/local/lib/python2.6/dist-packages/spyne-2.9.3-py2.6.egg/spyne/protocol/xml/model.py", line 79, in base_from_element >> raise ValidationError(element.text) >> ValidationError: Fault(Client.ValidationError: 'The value "\'6000.0\'" could not be validated.') >> >> >> >> >> >> ______________________________________________________________ >>> Od: "Burak Arslan" >>> Komu: azurIt >>> D?tum: 26.02.2013 09:56 >>> Predmet: Re: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 >>> >>> CC: soap at python.org >>> Hi Azur, >>> >>> That's the suds traceback. What does the traceback from the spyne side say? >>> >>> Best, >>> Burak >>> >>> >>> >>> On 02/25/13 16:00, azurIt wrote: >>>> Hi, >>>> >>>> i'm having problems with spyne 2.9.3 and lxml 3.1.0. When i try to use Integer or Float as an parameter to function, this error is printed: >>>> >>>> Traceback (most recent call last): >>>> File "client.py", line 4, in >>>> result = client.service.test(6000.0) >>>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 542, in __call__ >>>> return client.invoke(args, kwargs) >>>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke >>>> result = self.send(soapenv) >>>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 649, in send >>>> result = self.failed(binding, e) >>>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 702, in failed >>>> r, p = binding.get_fault(reply) >>>> File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/bindings/binding.py", line 265, in get_fault >>>> raise WebFault(p, faultroot) >>>> suds.WebFault: Server raised fault: 'The value "'6000.0'" could not be validated.' >>>> >>>> Everything works with these configurations: >>>> rpclib 2.7.0 + lxml 3.1.0 >>>> spyne 2.9.3 + lxml 2.3.2 >>>> rpclib 2.7.0 + lxml 2.3.3 >>>> >>>> >>>> Any ideas? Thnx. >>>> >>>> azur >>>> _______________________________________________ >>>> Soap mailing list >>>> Soap at python.org >>>> http://mail.python.org/mailman/listinfo/soap >>> > > From burak.arslan at arskom.com.tr Tue Feb 26 13:13:25 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 26 Feb 2013 14:13:25 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130226112138.4C5E7A4D@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk> <512C8A17.3060105@arskom.com.tr> <20130226112138.4C5E7A4D@pobox.sk> Message-ID: <512CA6E5.7090601@arskom.com.tr> On 02/26/13 12:21, azurIt wrote: > Server: > http://pastebin.com/Njhbf4SM > > Client: > http://pastebin.com/6NCMHFpN > > run server with spyne 2.9.3 and lxml 3.1.0 > Hi Azur, It's always easier to work with github gists: https://gist.github.com/plq/5037952 Sorry but I can't reproduce your issue. Are you sure your spyne version is not a patched one? What's your output for the server? Best, Burak From azurit at pobox.sk Tue Feb 26 14:12:47 2013 From: azurit at pobox.sk (azurIt) Date: Tue, 26 Feb 2013 14:12:47 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512CA6E5.7090601@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk> <512CA6E5.7090601@arskom.com.tr> Message-ID: <20130226141247.F8E78E4F@pobox.sk> >Hi Azur, > >It's always easier to work with github gists: >https://gist.github.com/plq/5037952 > >Sorry but I can't reproduce your issue. Are you sure your spyne version >is not a patched one? What's your output for the server? > >Best, >Burak I added my server result as a comment to https://gist.github.com/plq/5037952 strange you can't reproduce it, so problem will be in something else. but where? From azurit at pobox.sk Tue Feb 26 14:16:13 2013 From: azurit at pobox.sk (azurIt) Date: Tue, 26 Feb 2013 14:16:13 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512CA6E5.7090601@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk> <512CA6E5.7090601@arskom.com.tr> Message-ID: <20130226141613.FCC9E99B@pobox.sk> >Hi Azur, > >It's always easier to work with github gists: >https://gist.github.com/plq/5037952 > >Sorry but I can't reproduce your issue. Are you sure your spyne version >is not a patched one? What's your output for the server? > >Best, >Burak > And result from your change in server: INFO:root:Spyne version: '2.9.3' INFO:root:lxml version: '3.1.0' INFO:root:Float constraints: lt: Decimal('Infinity') le: Decimal('Infinity') gt: Decimal('-Infinity') ge: Decimal('-Infinity') INFO:root:Integer constraints: lt: Decimal('Infinity') le: Decimal('Infinity') gt: Decimal('-Infinity') ge: Decimal('-Infinity') From burak.arslan at arskom.com.tr Tue Feb 26 14:33:46 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 26 Feb 2013 15:33:46 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130226141247.F8E78E4F@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk> <512CA6E5.7090601@arskom.com.tr> <20130226141247.F8E78E4F@pobox.sk> Message-ID: <512CB9BA.5060602@arskom.com.tr> On 02/26/13 15:12, azurIt wrote: >> Hi Azur, >> >> It's always easier to work with github gists: >> https://gist.github.com/plq/5037952 >> >> Sorry but I can't reproduce your issue. Are you sure your spyne version >> is not a patched one? What's your output for the server? >> >> Best, >> Burak > > > > I added my server result as a comment to https://gist.github.com/plq/5037952 yes i just saw it. > strange you can't reproduce it, so problem will be in something else. but where? huh. i have no idea why it's not working. what could be different between your setup and mine? what version of python is it? are you still on python 2.5? my tests are done with 2.7.3 on x64 Linux. what about you? fwiw, it's working with lxml 3.0.x as well. the last thing you could do is to import pdb; pdb.set_trace() right before the validation call and trace the execution line by line (pressing s) to find any 'strangeness'. if you want a nicer debugger, do 'easy_install ipdb' and do import ipdb; ipdb.set_trace() instead. good luck! burak From azurit at pobox.sk Tue Feb 26 14:40:51 2013 From: azurit at pobox.sk (azurIt) Date: Tue, 26 Feb 2013 14:40:51 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512CB9BA.5060602@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> Message-ID: <20130226144051.B95F32D6@pobox.sk> >>> Hi Azur, >>> >>> It's always easier to work with github gists: >>> https://gist.github.com/plq/5037952 >>> >>> Sorry but I can't reproduce your issue. Are you sure your spyne version >>> is not a patched one? What's your output for the server? >>> >>> Best, >>> Burak >> >> >> >> I added my server result as a comment to https://gist.github.com/plq/5037952 > >yes i just saw it. > >> strange you can't reproduce it, so problem will be in something else. but where? > >huh. i have no idea why it's not working. what could be different >between your setup and mine? what version of python is it? are you still >on python 2.5? my tests are done with 2.7.3 on x64 Linux. what about you? This was python 2.6.6 on 32bit linux. >fwiw, it's working with lxml 3.0.x as well. It looks like my float was converted to string/unicode as there are two quotes in error message: The value "'6000.0'" could not be validated. So the value is '6000.0' (with quotes). Strange is that it is working fine on the same server with rpclib 2.7.0. >the last thing you could do is to import pdb; pdb.set_trace() right >before the validation call and trace the execution line by line >(pressing s) to find any 'strangeness'. Will try it, thank you. >if you want a nicer debugger, do 'easy_install ipdb' and do import ipdb; >ipdb.set_trace() instead. > >good luck! >burak From burak.arslan at arskom.com.tr Tue Feb 26 14:53:40 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 26 Feb 2013 15:53:40 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130226144051.B95F32D6@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> <20130226144051.B95F32D6@pobox.sk> Message-ID: <512CBE64.4040808@arskom.com.tr> On 02/26/13 15:40, azurIt wrote: > It looks like my float was converted to string/unicode as there are two quotes in error message: > The value "'6000.0'" could not be validated. The reason for that is that I send element.text to ValidationError exception. https://github.com/arskom/spyne/blob/spyne-2.9.3/spyne/protocol/xml/model.py#L79 Just fixed it. https://github.com/plq/spyne/commit/057efce313858e8f7142270a45a580e811a80fcf burak From azurit at pobox.sk Tue Feb 26 16:26:59 2013 From: azurit at pobox.sk (azurIt) Date: Tue, 26 Feb 2013 16:26:59 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512CB9BA.5060602@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> Message-ID: <20130226162659.238FF3B7@pobox.sk> >huh. i have no idea why it's not working. what could be different >between your setup and mine? what version of python is it? are you still >on python 2.5? my tests are done with 2.7.3 on x64 Linux. what about you? Ok, i found out that this is NOT related to lxml. No matter which lxml version is install, it's not working under Python 2.6 (i have 2.6.6) with rpclib/spyne >= 2.8.0. Always works with Python 2.7. Can you try it with p2.6 please? From burak.arslan at arskom.com.tr Tue Feb 26 23:41:02 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 27 Feb 2013 00:41:02 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130226162659.238FF3B7@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> <20130226162659.238FF3B7@pobox.sk> Message-ID: <512D39FE.4060009@arskom.com.tr> On 02/26/13 17:26, azurIt wrote: >> huh. i have no idea why it's not working. what could be different >> between your setup and mine? what version of python is it? are you still >> on python 2.5? my tests are done with 2.7.3 on x64 Linux. what about you? > > Ok, i found out that this is NOT related to lxml. No matter which lxml version is install, it's not working under Python 2.6 (i have 2.6.6) with rpclib/spyne >= 2.8.0. Always works with Python 2.7. Can you try it with p2.6 please? Whaat?! What kind of nonsense is this? Python 2.6.8 (unknown, Feb 26 2013, 17:49:34) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> Decimal('Infinity') > 5 True >>> Decimal('Infinity') > 5.0 False >>> Python 2.5 seems to get it right: Python 2.5.4 (r254:67916, Feb 1 2013, 04:01:02) [GCC 4.5.4] on linux3 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> Decimal('Infinity') > 5 True >>> Decimal('Infinity') > 5.0 True >>> Fixed for both in 2.9 and 2.10 in f1443cf2262fe24f10eab42826e774abdb9f56b3. Azur, thanks for the bug report. Best, Burak From anthony.risinger at corvisa.com Wed Feb 27 00:56:17 2013 From: anthony.risinger at corvisa.com (C Anthony Risinger) Date: Tue, 26 Feb 2013 17:56:17 -0600 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <512D39FE.4060009@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> <20130226162659.238FF3B7@pobox.sk> <512D39FE.4060009@arskom.com.tr> Message-ID: <512D4BA1.50005@corvisa.com> On 02/26/2013 04:41 PM, Burak Arslan wrote: > On 02/26/13 17:26, azurIt wrote: >>> huh. i have no idea why it's not working. what could be different >>> between your setup and mine? what version of python is it? are you still >>> on python 2.5? my tests are done with 2.7.3 on x64 Linux. what about >>> you? >> >> Ok, i found out that this is NOT related to lxml. No matter which lxml >> version is install, it's not working under Python 2.6 (i have 2.6.6) >> with rpclib/spyne >= 2.8.0. Always works with Python 2.7. Can you try >> it with p2.6 please? > > Whaat?! What kind of nonsense is this? > > Python 2.6.8 (unknown, Feb 26 2013, 17:49:34) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from decimal import Decimal > >>> Decimal('Infinity') > 5 > True > >>> Decimal('Infinity') > 5.0 > False > >>> > > Python 2.5 seems to get it right: > > Python 2.5.4 (r254:67916, Feb 1 2013, 04:01:02) > [GCC 4.5.4] on linux3 > Type "help", "copyright", "credits" or "license" for more information. > >>> from decimal import Decimal > >>> Decimal('Infinity') > 5 > True > >>> Decimal('Infinity') > 5.0 > True > >>> > > Fixed for both in 2.9 and 2.10 in f1443cf2262fe24f10eab42826e774abdb9f56b3. > > Azur, thanks for the bug report. are you sure you want to go this route? back when i changed this to Decimal it was specifically to avoid these issues (as much as possible anyway): https://github.com/arskom/spyne/pull/155 ...i never tested arbitrary floats. it appears *all* Decimal objects compare as less than a float(). unfortunate. floats are hardware dependent and unsuitable for *anything* that requires some notion of knowable accuracy -- my suggestion would be to wrap incoming Attribute values with a compat layer or something, at the expense of performance :( -- eg, convert incoming float -> str -> Decimal, or probably better, throw an exception (float() + Decimal() already throws, but Python has an [unwritten?] practice of "anything compares to anything" which is the only reason it's attempted at all) ...this is a known pain point AFAICT: http://bugs.python.org/issue2531 ...but at the end of the day, Decimal is the most suitable primitive IMO. -- C Anthony ----------------------------------------- CONFIDENTIALITY: The information contained in this communication may be confidential and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete any copy of it from your computer system. From azurit at pobox.sk Wed Feb 27 08:42:18 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 08:42:18 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512D39FE.4060009@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk> <512D39FE.4060009@arskom.com.tr> Message-ID: <20130227084218.BE460B80@pobox.sk> >Fixed for both in 2.9 and 2.10 in f1443cf2262fe24f10eab42826e774abdb9f56b3. Cool, it works! Thank you very much :) azur From azurit at pobox.sk Wed Feb 27 10:48:08 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 10:48:08 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <20130227084218.BE460B80@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr> <20130227084218.BE460B80@pobox.sk> Message-ID: <20130227104808.15FE95F9@pobox.sk> >>Fixed for both in 2.9 and 2.10 in f1443cf2262fe24f10eab42826e774abdb9f56b3. > > >Cool, it works! Thank you very much :) When is new version of Spyne planned? I'm really too lazy to patch all servers by hand ;) Thank you. From burak.arslan at arskom.com.tr Wed Feb 27 10:48:15 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 27 Feb 2013 11:48:15 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <512D4BA1.50005@corvisa.com> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> <20130226162659.238FF3B7@pobox.sk> <512D39FE.4060009@arskom.com.tr> <512D4BA1.50005@corvisa.com> Message-ID: <512DD65F.20108@arskom.com.tr> On 02/27/13 01:56, C Anthony Risinger wrote: > floats are hardware dependent and unsuitable for *anything* that > requires some notion of knowable accuracy -- my suggestion would be to > wrap incoming Attribute values with a compat layer or something, at > the expense of performance :( -- eg, convert incoming float -> str -> > Decimal, or probably better, throw an exception (float() + Decimal() > already throws, but Python has an [unwritten?] practice of "anything > compares to anything" which is the only reason it's attempted at all) Hi Anthony, Well, this is a quirk of Python 2.6 which is already fixed in later releases. That's why the code in this patch only works when the interpreter's version is 2.6. So I don't think it'd make sense to make the life of those who don't use it harder, especially for a "transient" bug such as this. > > ...this is a known pain point AFAICT: > > http://bugs.python.org/issue2531 > > ...but at the end of the day, Decimal is the most suitable primitive IMO. > I agree, that's why I say '[double] comes with its gotchas': http://spyne.io/docs/reference/model.html#spyne.model.primitive.Double. I'm going to make that text clearer though. But if the user wants to use this, hey, it's in the XML Schema spec, we can't stop them. What do you think? Best, Burak From burak.arslan at arskom.com.tr Wed Feb 27 10:52:43 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 27 Feb 2013 11:52:43 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130227104808.15FE95F9@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr> <20130227084218.BE460B80@pobox.sk> <20130227104808.15FE95F9@pobox.sk> Message-ID: <512DD76B.5050106@arskom.com.tr> On 02/27/13 11:48, azurIt wrote: >>> Fixed for both in 2.9 and 2.10 in f1443cf2262fe24f10eab42826e774abdb9f56b3. >> >> Cool, it works! Thank you very much :) > > When is new version of Spyne planned? I'm really too lazy to patch all servers by hand ;) Thank you. in half an hour :) From azurit at pobox.sk Wed Feb 27 11:00:44 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 11:00:44 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512DD76B.5050106@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, <20130227084218.BE460B80@pobox.sk>, <20130227104808.15FE95F9@pobox.sk> <512DD76B.5050106@arskom.com.tr> Message-ID: <20130227110044.B34A4B67@pobox.sk> >>>> Fixed for both in 2.9 and 2.10 in f1443cf2262fe24f10eab42826e774abdb9f56b3. >>> >>> Cool, it works! Thank you very much :) >> >> When is new version of Spyne planned? I'm really too lazy to patch all servers by hand ;) Thank you. > > >in half an hour :) Whoaaa, too cool to be true! ;) From esiotrot at gmail.com Wed Feb 27 11:24:42 2013 From: esiotrot at gmail.com (Michael Wood) Date: Wed, 27 Feb 2013 12:24:42 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <512D39FE.4060009@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk> <512C78B1.6030003@arskom.com.tr> <20130226104443.5A62F102@pobox.sk> <512C8A17.3060105@arskom.com.tr> <20130226112138.4C5E7A4D@pobox.sk> <512CA6E5.7090601@arskom.com.tr> <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> <20130226162659.238FF3B7@pobox.sk> <512D39FE.4060009@arskom.com.tr> Message-ID: On 27 February 2013 00:41, Burak Arslan wrote: > On 02/26/13 17:26, azurIt wrote: >>> >>> huh. i have no idea why it's not working. what could be different >>> between your setup and mine? what version of python is it? are you still >>> on python 2.5? my tests are done with 2.7.3 on x64 Linux. what about you? >> >> >> Ok, i found out that this is NOT related to lxml. No matter which lxml >> version is install, it's not working under Python 2.6 (i have 2.6.6) with >> rpclib/spyne >= 2.8.0. Always works with Python 2.7. Can you try it with >> p2.6 please? > > > Whaat?! What kind of nonsense is this? > > Python 2.6.8 (unknown, Feb 26 2013, 17:49:34) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> from decimal import Decimal >>>> Decimal('Infinity') > 5 > True >>>> Decimal('Infinity') > 5.0 > False >>>> Works for me on 2.6.5 (Ubuntu 10.04) $ python Python 2.6.5 (r265:79063, Oct 1 2012, 22:04:36) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> Decimal('Infinity') > 5 True >>> Decimal('Infinity') > 5.0 True -- Michael Wood From azurit at pobox.sk Wed Feb 27 11:30:25 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 11:30:25 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr> Message-ID: <20130227113025.A1C51E2D@pobox.sk> > CC: soap at python.org >On 27 February 2013 00:41, Burak Arslan wrote: >> On 02/26/13 17:26, azurIt wrote: >>>> >>>> huh. i have no idea why it's not working. what could be different >>>> between your setup and mine? what version of python is it? are you still >>>> on python 2.5? my tests are done with 2.7.3 on x64 Linux. what about you? >>> >>> >>> Ok, i found out that this is NOT related to lxml. No matter which lxml >>> version is install, it's not working under Python 2.6 (i have 2.6.6) with >>> rpclib/spyne >= 2.8.0. Always works with Python 2.7. Can you try it with >>> p2.6 please? >> >> >> Whaat?! What kind of nonsense is this? >> >> Python 2.6.8 (unknown, Feb 26 2013, 17:49:34) >> [GCC 4.6.3] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >>>>> from decimal import Decimal >>>>> Decimal('Infinity') > 5 >> True >>>>> Decimal('Infinity') > 5.0 >> False >>>>> > >Works for me on 2.6.5 (Ubuntu 10.04) > >$ python >Python 2.6.5 (r265:79063, Oct 1 2012, 22:04:36) >[GCC 4.4.3] on linux2 >Type "help", "copyright", "credits" or "license" for more information. >>>> from decimal import Decimal >>>> Decimal('Infinity') > 5 >True >>>> Decimal('Infinity') > 5.0 >True > >-- >Michael Wood > Hm, strange, works also here on 2.6.6 (tried both 32bit and 64bit): Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> Decimal('Infinity') > 5 True >>> Decimal('Infinity') > 5.0 True But spyne had problems and latest patch fixed it for me so it must be also in something else. From burak.arslan at arskom.com.tr Wed Feb 27 11:40:31 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 27 Feb 2013 12:40:31 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130227113025.A1C51E2D@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr> <20130227113025.A1C51E2D@pobox.sk> Message-ID: <512DE29F.3020809@arskom.com.tr> 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? By the way, 2.9.4 is out on the pypi. I was hoping for this to be the last release in 2.9 series, but if we get to the bottom of this quirk, I can make another release. Best, Burak > Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> >>>from decimal import Decimal >>>> >>>Decimal('Infinity') > 5 > True >>>> >>>Decimal('Infinity') > 5.0 > True From azurit at pobox.sk Wed Feb 27 11:46:23 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 11:46:23 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512DE29F.3020809@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, , <20130227113025.A1C51E2D@pobox.sk> <512DE29F.3020809@arskom.com.tr> Message-ID: <20130227114623.C5FC1F7E@pobox.sk> > 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). From burak.arslan at arskom.com.tr Wed Feb 27 11:53:54 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 27 Feb 2013 12:53:54 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130227114623.C5FC1F7E@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, , <20130227113025.A1C51E2D@pobox.sk> <512DE29F.3020809@arskom.com.tr> <20130227114623.C5FC1F7E@pobox.sk> Message-ID: <512DE5C2.9050600@arskom.com.tr> 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? Thanks, Burak From azurit at pobox.sk Wed Feb 27 12:00:28 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 12:00:28 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512DE5C2.9050600@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, , <20130227113025.A1C51E2D@pobox.sk>, <512DE29F.3020809@arskom.com.tr>, <20130227114623.C5FC1F7E@pobox.sk> <512DE5C2.9050600@arskom.com.tr> Message-ID: <20130227120028.82DA9146@pobox.sk> > 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. From burak.arslan at arskom.com.tr Wed Feb 27 12:05:11 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 27 Feb 2013 13:05:11 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130227120028.82DA9146@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, , <20130227113025.A1C51E2D@pobox.sk>, <512DE29F.3020809@arskom.com.tr>, <20130227114623.C5FC1F7E@pobox.sk> <512DE5C2.9050600@arskom.com.tr> <20130227120028.82DA9146@pobox.sk> Message-ID: <512DE867.706@arskom.com.tr> 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 From azurit at pobox.sk Wed Feb 27 12:22:41 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 12:22:41 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512DE867.706@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, , <20130227113025.A1C51E2D@pobox.sk>, <512DE29F.3020809@arskom.com.tr>, <20130227114623.C5FC1F7E@pobox.sk>, <512DE5C2.9050600@arskom.com.tr>, <20130227120028.82DA9146@pobox.sk> <512DE867.706@arskom.com.tr> Message-ID: <20130227122241.EBC3A986@pobox.sk> > 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 From esiotrot at gmail.com Wed Feb 27 12:33:39 2013 From: esiotrot at gmail.com (Michael Wood) Date: Wed, 27 Feb 2013 13:33:39 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130227122241.EBC3A986@pobox.sk> References: <20130225150014.71B90383@pobox.sk> <512C78B1.6030003@arskom.com.tr> <20130226104443.5A62F102@pobox.sk> <512C8A17.3060105@arskom.com.tr> <20130226112138.4C5E7A4D@pobox.sk> <512CA6E5.7090601@arskom.com.tr> <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> <20130226162659.238FF3B7@pobox.sk> <512D39FE.4060009@arskom.com.tr> <20130227113025.A1C51E2D@pobox.sk> <512DE29F.3020809@arskom.com.tr> <20130227114623.C5FC1F7E@pobox.sk> <512DE5C2.9050600@arskom.com.tr> <20130227120028.82DA9146@pobox.sk> <512DE867.706@arskom.com.tr> <20130227122241.EBC3A986@pobox.sk> Message-ID: On 27 February 2013 13:22, azurIt 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 From burak.arslan at arskom.com.tr Wed Feb 27 12:35:06 2013 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 27 Feb 2013 13:35:06 +0200 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <20130227122241.EBC3A986@pobox.sk> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, , <20130227113025.A1C51E2D@pobox.sk>, <512DE29F.3020809@arskom.com.tr>, <20130227114623.C5FC1F7E@pobox.sk>, <512DE5C2.9050600@arskom.com.tr>, <20130227120028.82DA9146@pobox.sk> <512DE867.706@arskom.com.tr> <20130227122241.EBC3A986@pobox.sk> Message-ID: <512DEF6A.5050007@arskom.com.tr> On 02/27/13 13:22, azurIt wrote: > Ok, i probably got it. It's related to -inf in Python 2.6.6: >>>> Decimal('-inf') > 1.0 > True >>>> Decimal('-inf') > 1 > False > Well, not-quite-so-surprisingly, that's working for me. Python 2.6.8 (unknown, Feb 26 2013, 17:49:34) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> Decimal('-inf') > 0.0 False >>> Decimal('-inf') > 0 False >>> Anyway, the patch seems ok, so let's move on :) Thanks for your time. Best, Burak From azurit at pobox.sk Wed Feb 27 12:37:20 2013 From: azurit at pobox.sk (azurIt) Date: Wed, 27 Feb 2013 12:37:20 +0100 Subject: [Soap-Python] =?utf-8?q?Problem_with_spyne_2=2E9=2E3_and_lxml_3?= =?utf-8?q?=2E1=2E0?= In-Reply-To: <512DEF6A.5050007@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk>, <512CB9BA.5060602@arskom.com.tr>, <20130226162659.238FF3B7@pobox.sk>, <512D39FE.4060009@arskom.com.tr>, , <20130227113025.A1C51E2D@pobox.sk>, <512DE29F.3020809@arskom.com.tr>, <20130227114623.C5FC1F7E@pobox.sk>, <512DE5C2.9050600@arskom.com.tr>, <20130227120028.82DA9146@pobox.sk>, <512DE867.706@arskom.com.tr>, <20130227122241.EBC3A986@pobox.sk> <512DEF6A.5050007@arskom.com.tr> Message-ID: <20130227123720.F40C3648@pobox.sk> > CC: soap at python.org >On 02/27/13 13:22, azurIt wrote: >> Ok, i probably got it. It's related to -inf in Python 2.6.6: >>>>> Decimal('-inf') > 1.0 >> True >>>>> Decimal('-inf') > 1 >> False >> > >Well, not-quite-so-surprisingly, that's working for me. > >Python 2.6.8 (unknown, Feb 26 2013, 17:49:34) >[GCC 4.6.3] on linux2 >Type "help", "copyright", "credits" or "license" for more information. > >>> from decimal import Decimal > >>> Decimal('-inf') > 0.0 >False > >>> Decimal('-inf') > 0 >False > >>> :D so python 2.6.7 or .8 fixed -inf and broke inf ;) From anthony.risinger at corvisa.com Wed Feb 27 17:56:55 2013 From: anthony.risinger at corvisa.com (C Anthony Risinger) Date: Wed, 27 Feb 2013 10:56:55 -0600 Subject: [Soap-Python] Problem with spyne 2.9.3 and lxml 3.1.0 In-Reply-To: <512DD65F.20108@arskom.com.tr> References: <20130225150014.71B90383@pobox.sk>, <512C78B1.6030003@arskom.com.tr>, <20130226104443.5A62F102@pobox.sk>, <512C8A17.3060105@arskom.com.tr>, <20130226112138.4C5E7A4D@pobox.sk>, <512CA6E5.7090601@arskom.com.tr>, <20130226141247.F8E78E4F@pobox.sk> <512CB9BA.5060602@arskom.com.tr> <20130226162659.238FF3B7@pobox.sk> <512D39FE.4060009@arskom.com.tr> <512D4BA1.50005@corvisa.com> <512DD65F.20108@arskom.com.tr> Message-ID: <512E3AD7.5090801@corvisa.com> On 02/27/2013 03:48 AM, Burak Arslan wrote: > On 02/27/13 01:56, C Anthony Risinger wrote: >> >> ...this is a known pain point AFAICT: >> >> http://bugs.python.org/issue2531 >> >> ...but at the end of the day, Decimal is the most suitable primitive IMO. >> > > I agree, that's why I say '[double] comes with its gotchas': > http://spyne.io/docs/reference/model.html#spyne.model.primitive.Double. > I'm going to make that text clearer though. > > But if the user wants to use this, hey, it's in the XML Schema spec, we > can't stop them. > > What do you think? yeah it's all well and good... i definately wouldnt put too much time into it since it's pretty much acceptably broken across all of Python. the only thing i would suggest is rather than enabling for py2.6 only, do a couple tests to see if Decimal is reliable, say: if not ( Decimal('inf') == float('inf') and Decimal('-inf') == float('-inf') and Decimal('inf') > float('0') and Decimal('-inf') < float('0') ): [...] ...since some people say 2.6 works, others say it doesn't, etc etc... since it all depends on the users hardware, keying off Python version will be hit-or-miss at best. -- C Anthony ----------------------------------------- CONFIDENTIALITY: The information contained in this communication may be confidential and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete any copy of it from your computer system.