Re: [Python-Dev] CPython crash with '%o'

2007-11-14 Thread Guido van Rossum
I take back the first "Yes" answer. Alas, the % operator is a mess, especially for %d/%o/%x. For subclassed longs, it *is* attempting to call the overridden __oct__, and this is causing the SystemError. It looks like this code wasn't really revisited when subclassing int and long was introduced. :-

Re: [Python-Dev] CPython crash with '%o'

2007-11-14 Thread Guido van Rossum
Yes, and yes. There may be time still to fix the SystemError in 2.5.2! On Nov 14, 2007 11:16 AM, Mike Stall <[EMAIL PROTECTED]> wrote: > > > > > This is my first post, so here's a quick intro: I've recently joined the > IronPython team at Microsoft, after about 6 years as a developer on the the >

Re: [Python-Dev] CPython crash with '%o'

2007-11-14 Thread Christian Heimes
Mike Stall wrote: > Traceback (most recent call last): > File "", line 1, in > SystemError: \loewis\25\python\Objects\stringobject.c:4236: bad argument to > internal function > Note that if c derives from 'int' instead of 'long', everything works as > expected. I'm able to reproduce the error

[Python-Dev] CPython crash with '%o'

2007-11-14 Thread Mike Stall
This is my first post, so here's a quick intro: I've recently joined the IronPython team at Microsoft, after about 6 years as a developer on the the .NET runtime (CLR). I'm currently trying to make IronPython match CPython's behavior regarding some % format string to a level of detail not docum