hp 11.11 64 bit python 2.5 build gets error "import site failed"

bhochstetler at gmail.com bhochstetler at gmail.com
Thu May 3 09:01:01 EDT 2007


On May 2, 5:09 pm, "Martin v. Löwis" <mar... at v.loewis.de> wrote:
> > "import site failed"
> > OverflowError: signed integer is greater than the maximum.
>
> > This is happening in the convertsimple() routine when it tries to
> > return a signed int:
>
> > ival = PyInt_AsLong(arg)
>
> > the ival is larger than what is defined in INT_MAX.
>
> > Why is this happening in a standard HP 64 bit build?
>
> Can you provide a complete gdb/dbx backtrace?
>
> Some function tries to convert a Python int into a C int,
> using the "i" conversion character. Python int uses C long
> for internal representation, and that particular C long
> happens to be larger than  INT_MAX. This is quite reasonable
> to happen in principle, but shouldn't happen on interpreter
> startup.
>
> So the questions are:
> - what are the callers of convertsimple here? (in particular,
>   where does the call to PyArg_ParseTuple come from?)
> - what is the value of ival?
> - where does that number come from?
>
> The first two questions are best answered with a C debugger.
> Depending on the answer, the third question may nor may not
> need an answer.
>
> Good luck,
> Martin
>
> P.S. If you are asking in the more abstract sense "why is that
> happening to me?", the answer is "because you are using an
> uncommon platform on which Python sees little or no testing".
> To work around, try a 32-bit build, or switch to Solaris,
> OS X, Debian Linux, or (heaven forbid) MS Windows :-)



> - what are the callers of convertsimple here? (in particular,
>   where does the call to PyArg_ParseTuple come from?)
since the debugger locks up when I run, here is a printf call stack of
where things are happening:

import site # precompiled from ...
builtin___import__
PyArg_ParseTupleAndKeywords
vgetargskeywords: positional arg: 0
convertitem
vgetargskeywords: positional arg: 1
convertitem
vgetargskeywords: positional arg: 2
convertitem
vgetargskeywords: positional arg: 3
convertitem
vgetargskeywords: positional arg: 4
convertitem

> - what is the value of ival?
ival: 4294967295

> - where does that number come from?

It is coming from the call to PyInt_AsLong. In that function there is
a call to:
PyInt_AS_LONG((PyIntObject*)op)
which returns the value of ival.

I wish we could just skip this port, but it is required for our
product that we have HP 64 bit. This did not happen with python 2.3.1
or 2.0.

Thanks for the help.

Brad




More information about the Python-list mailing list