473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get
my python executable created and run it, I get the error:

"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?
Any help on fixing this problem is greatly appreciated.

Brad

May 2 '07 #1
6 2044
"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 :-)
May 2 '07 #2
On May 2, 5:09 pm, "Martin v. Löwis" <mar...@v.loewis.dewrote:
"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

May 3 '07 #3
bh**********@gmail.com schrieb:
I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get
my python executable created and run it, I get the error:

"import site failed"
OverflowError: signed integer is greater than the maximum.
Are you sure about the error message? That error is never produced
in Python. Instead, it may print an OverflowError with

signed integer is greater than maximum

(i.e. no period, no "the").

Regards,
Martin
May 3 '07 #4
>>"import site failed"
>>OverflowError: signed integer is greater than the maximum.
>- what is the value of ival?
ival: 4294967295
I see. This is 0xFFFFFFFF, which would be -1 if it were of type
int. So perhaps some value got cast incorrectly at some point,
breaking subsequent computations
>
>- 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.
That was not my question, really. I wanted to know where the object
whose AsLong value was taken came from. And before you say "it's
in the arg parameter" of convertsimple() - sure it is. However, how
did it get there? It's in an argument tuple - and where came
that from?

IOW, you really need to know who the caller of convertsimple is,
and what line of Python code precisely was triggering that call.

Regards,
Martin
May 3 '07 #5
On May 3, 2:54 pm, "Martin v. Löwis" <mar...@v.loewis.dewrote:
>"import site failed"
OverflowError: signed integer is greater than the maximum.
- what is the value of ival?
ival: 4294967295

I see. This is 0xFFFFFFFF, which would be -1 if it were of type
int. So perhaps some value got cast incorrectly at some point,
breaking subsequent computations
- 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.

That was not my question, really. I wanted to know where the object
whose AsLong value was taken came from. And before you say "it's
in the arg parameter" of convertsimple() - sure it is. However, how
did it get there? It's in an argument tuple - and where came
that from?
Looking at the call stack OP posted, -1 is coming as forth parameter
of
__import__, I *guess* at the first import in site.py or at implicit
"import site". I think it'd be helpful if OP also tried if it works:
python -S -c -v "print -1, type(-1), id(0), id(-1)"
-- Leo

May 4 '07 #6
On May 4, 1:17 am, Leo Kislov <Leo.Kis...@gmail.comwrote:
On May 3, 2:54 pm, "Martin v. Löwis" <mar...@v.loewis.dewrote:
>>"import site failed"
>>OverflowError: signed integer is greater than the maximum.
>- what is the value of ival?
ival: 4294967295
I see. This is 0xFFFFFFFF, which would be -1 if it were of type
int. So perhaps some value got cast incorrectly at some point,
breaking subsequent computations
>- 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.
That was not my question, really. I wanted to know where the object
whose AsLong value was taken came from. And before you say "it's
in the arg parameter" of convertsimple() - sure it is. However, how
did it get there? It's in an argument tuple - and where came
that from?

Looking at the call stack OP posted, -1 is coming as forth parameter
of
__import__, I *guess* at the first import in site.py or at implicit
"import site". I think it'd be helpful if OP also tried if it works:
python -S -c -v "print -1, type(-1), id(0), id(-1)"

-- Leo
Here is the output, along with my printf statements that show the call
stack:

builtin___import__
PyArg_ParseTupleAndKeywords
vgetargskeywords: positional arg: 0
convertitem
vgetargskeywords: positional arg: 1
convertitem
vgetargskeywords: positional arg: 2
convertitem
vgetargskeywords: positional arg: 3
convertitem
builtin___import__
PyArg_ParseTupleAndKeywords
vgetargskeywords: positional arg: 0
convertitem
vgetargskeywords: positional arg: 1
convertitem
vgetargskeywords: positional arg: 2
convertitem
vgetargskeywords: positional arg: 3
convertitem
BRAD 20
PyArg_ParseTupleAndKeywords
vgetargskeywords: positional arg: 0
convertitem
vgetargskeywords: positional arg: 1
convertitem
vgetargskeywords: positional arg: 2
convertitem
builtin___import__
PyArg_ParseTupleAndKeywords
vgetargskeywords: positional arg: 0
convertitem
vgetargskeywords: positional arg: 1
convertitem
vgetargskeywords: positional arg: 2
convertitem
vgetargskeywords: positional arg: 3
convertitem
builtin___import__
PyArg_ParseTupleAndKeywords
vgetargskeywords: positional arg: 0
convertitem
vgetargskeywords: positional arg: 1
convertitem
vgetargskeywords: positional arg: 2
convertitem
vgetargskeywords: positional arg: 3
convertitem
convertitem
convertitem
convertitem
convertitem
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
ival: 4294967295
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
ival: 4294967295
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'v' is not defined

May 4 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vio | last post by:
Hi, I've been trying to embed (statically) wxPy alongside an embedded py interpreter on a linux/gtk box. At one point, for some reason misc.o linking reported "multiple definitions of...
3
by: gerald.maher | last post by:
Hi, I am trying to excuate the follwong code: I get the following error: Here is my Lib path:
0
by: Bill Davy | last post by:
I am working with MSVC6 on Windows XP. I have created an MSVC project called SHIP I have a file SHIP.i with "%module SHIP" as the first line (file is below). I run SHIP.i through SWIG 1.3.24...
0
by: camaro77 majau via DotNetMonster.com | last post by:
Sorry by my english but i'm from spain. I have a problem and after search by the web i have know that is due by framework. The message is : setup error "failed to load ressouces from resource...
3
by: Mudcat | last post by:
I have a directory structure that contains different modules that run depending on what the user selects. They are identical in name and structure, but what varies is the content of the functions....
5
by: Vijaya P Krishna | last post by:
Hi, I have a .NET Windows Forms application, written in VB.NET and C#. I am opening a URL from the application using Process.Start(). The URL points to a java servlet running on apache-tomcat....
3
by: Jim Hill | last post by:
Well, I've found about a hundred thousand web pages where people have had the same problem I have but nary a page with a solution that works for me. I want to do a simple embed, so I've followed...
5
by: xieliwei | last post by:
I have a freshly installed openSuSe 10.2 with PHP4 from http://download.opensuse.org/repositories/home:/michal-m:/php4/openSUSE_10.2/ (openSuSe abandoned PHP4 since version 10, but I have customers...
2
by: tvnaidu | last post by:
valgrind error - "failed to start tool 'memcheck' for platform x86-linux" no such file or dir copied all lib and bin files which are generated after I compiled valgrind package, when I run my exe...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.