neal norwitz vapkwvjqgmailcom thu mar 20 2008 213 trent nelson wrote test_getargs2 failing windows x64 test test_getargs2 failed traceback recent call last file sbuildbotspythonx6430nelsonwin64buildlibtesttest_getargs2py line 190 test_n selffailunlessequal99 getargs_nlong typeerror long object interpreted integer drilling source code arrives pythongetargscconvertsimple windows x64 sizeof_size_t sizeof_long theres case n statement defined following iobj pynumber_indexarg im little confused point arg pyobject argobj_typetp_as_numbernb_int nonzero value however pynumber_indexarg performs two checks object fails results typeerror raised pynumber_index works object int long __index__ method long class __int__ method otherwise regular userdefined class super class first check pylong_checkarg handled via pytype_fastsubclass ends following argobj_typetp_flags py_tpflags_long_subclass 0 tp_flags 284160 point py_tpflags_long_subclass 16777216 py_tpflags_int_subclass 8388608 check fails doesnt tp_flags either one values obj_typenb_int value shouldnt flags reflect type despite class name long object doesnt subclass int long thats tp_flags checks failing nb_int value __int__ method defined long ive checked 32bit build pynumber_index pyobject representing literal 99 also exhibits behaviour also 32bit build n code path visits pylong_aslong calls pylong_aslongandoverflow test cases calling getargs_n test overflow raised correctly notionally x64 windows size_t long long long shouldnt pylong_aslonglongandoverflow method apis seem confused im sure best way go either conceptually test trying need convert userdefined type long pyobject python long pylongobject convert py_ssize_t im sure test makes sense though test added uses value 232 264 ensure cover win64 case think best thing need clean apis make sense change code handles n follows pyobject iobj py_ssize_t p va_argp_va py_ssize_t py_ssize_t ival 1 float_argument_errorarg return converterrinteger arg msgbuf bufsize iobj pynumber_indexarg code added handle __int__ methods classes dont subclass int iobj null pyerr_clear using pynumber_long probably permissive converts strings objects __trunc__ probably check nb_int nb_long 3k slot specifically call iobj pynumber_longarg iobj null ival pylong_asssize_targ ival 1 pyerr_occurred return converterrinteger arg msgbuf bufsize p ival break im sure abusing n format doc doccapiargrst says turns arg py_ssize_t dont know __index__ really abused pep 357 added __index__ n _______________________________________________ python3000 mailing list smsbmo9552pythonorg httpmailpythonorgmailmanlistinfopython3000 unsubscribe httpmailpythonorgmailmanoptionspython3000python300040tangomucom wed 06 aug 2008 130514 0500 python3000 pylong_check behaviour clarification test_getargs2 failing windows x64