Re: Unittest failure in python decoder tests

2008-10-07 Thread Gregory P. Smith
int vs long is a python 2.x annoyance. It goes away in 3.x as the int vs long distinction disappears. Regardless, the correct thing to do in 2.x is to accept both int and long types, this unit test is being too strict. What matters is the actual value, not the exact type. In decoder_test.py Re

Re: Unittest failure in python decoder tests

2008-10-07 Thread Pavel Shramov
On Sun, Oct 05, 2008 at 11:41:53AM +0200, Iustin Pop wrote: > I don't understand exactly what's going on, but I think the problem is > that an i386 system cannot represent that constant as int, but amd64 can > (not sure why...): > $ python32 -c 'print type(0x)' > > $ python64 -c 'print ty

Re: Unittest failure in python decoder tests

2008-10-07 Thread Pavel Shramov
On Sun, Oct 05, 2008 at 11:41:53AM +0200, Iustin Pop wrote: > i386: result is , expected is > amd64: result is , expected is > > I don't understand exactly what's going on, but I think the problem is > that an i386 system cannot represent that constant as int, but amd64 can > (not sure why...):

Re: Unittest failure in python decoder tests

2008-10-06 Thread Kenton Varda
[+petar] (Same problem as the other thread.) On Sun, Oct 5, 2008 at 2:41 AM, Iustin Pop <[EMAIL PROTECTED]> wrote: > > Hi there, > > Revision 50 changed the following line in > python/google/protobuf/internal/decoder_test.py: > > 122: ['sfixed32', decoder.Decoder.ReadSFixed32, -1, > 'ReadLit

Re: Unittest failure in python decoder tests

2008-10-06 Thread Iustin Pop
On Sun, Oct 05, 2008 at 02:48:56AM -0700, [EMAIL PROTECTED] wrote: > > Wow we submitted the same bug 6 minutes off of each other. > The test also passes with a fix by changing long(-1) to -1 on the line > above. I'm not sure which change is the 'correct' one. Yes, but if you change long(-1) to

Re: Unittest failure in python decoder tests

2008-10-05 Thread fpmchu
You're right. I didn't read your email carefully. This is indeed strange behavior of Python. Frank On Oct 5, 3:05 am, Iustin Pop <[EMAIL PROTECTED]> wrote: > On Sun, Oct 05, 2008 at 02:48:56AM -0700, [EMAIL PROTECTED] wrote: > > > Wow we submitted the same bug 6 minutes off of each other. > >

Re: Unittest failure in python decoder tests

2008-10-05 Thread fpmchu
Wow we submitted the same bug 6 minutes off of each other. The test also passes with a fix by changing long(-1) to -1 on the line above. I'm not sure which change is the 'correct' one. Frank On Oct 5, 2:41 am, Iustin Pop <[EMAIL PROTECTED]> wrote: > Hi there, > > Revision 50 changed the followi