[Python-Dev] http://bugs.python.org/issue4977 - assumption that maxint64 fits into long on 32-bit systems

Luke Kenneth Casson Leighton luke.leighton at googlemail.com
Sat Jan 17 23:06:01 CET 2009


this was found as part of the regression tests, compiling python under
wine under msys with mingw32.  test_maxint64 failed.  i tracked it
down to the assumption that a long will fit into 32-bits, which
obviously... it won't!  the simplest case is to add a test for the
length of the data string being 10 or more characters, on the basis
that 9 or less is definitely going into an int; 11 or more is
_definitely_ going into a long, and... well... bugger the 10 case,
just stuff it in a long rather than waste time trying to find out how
many chars it is.

if anyone wants to do a more perfect version of this, simple patch,
they're mooore than welcome.

l.


More information about the Python-Dev mailing list