LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-30-2010, 09:21 PM   #1
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Rep: Reputation: 15
Unhappy python problem in linux


Hi all,

I am trying to run a code that is giving the following error ....
Code:
OverflowError: long int too large to convert
I have found its solution at http://groups.google.com/group/turbo...c946efa77bc9e3

But the procedure described there does not work.. There are problems in installing ruledispatch module...

I am using ubuntu-9.04...

Please help... Thanks in advance...

Regards
_Linux_Learner
 
Old 05-01-2010, 12:36 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826
Might help if you showed the relevant lines from your code
 
Old 05-01-2010, 08:34 AM   #3
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by grail View Post
Might help if you showed the relevant lines from your code
Following is the code...
Code:
d = self.data[off+i*8:off+(i+1)*8]
            if len(d):
                q = "Q"
                l = struct.unpack(q,d)
                arr_here = array.array("L", l)
The following error creeps in...
Code:
Traceback (most recent call last):
  File "./gen_PA.py", line 107, in <module>
    main()
  File "./gen_PA.py", line 101, in main
    arr = map_for_pid.range_to_pfn(mr[k][0],mr[k][1])
  File "./gen_PA.py", line 61, in range_to_pfn
    arr_here = array.array("L", l)
OverflowError: long int too large to convert
Please help
Thanks in advance

Regards
_Linux_Learner
 
Old 05-01-2010, 09:59 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826
So if you print the value of "l" prior to the conversion, what value is stored in it?
 
Old 05-01-2010, 12:45 PM   #5
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by grail View Post
So if you print the value of "l" prior to the conversion, what value is stored in it?
The value of l that I get is....
Code:
(9655717601082849515L,)
Regards
_Linux_Learner
 
Old 05-02-2010, 12:27 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826
hmmm ... seems I can input the following at the python prompt:

Code:
>>>import array
>>>l=(9655717601082849515L,)
>>>arr_here = array.array("L", l)
>>>print arr_here[0]
9655717601082849515
Do you get the error everytime?
 
Old 05-02-2010, 01:14 AM   #7
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by grail View Post
hmmm ... seems I can input the following at the python prompt:

Code:
>>>import array
>>>l=(9655717601082849515L,)
>>>arr_here = array.array("L", l)
>>>print arr_here[0]
9655717601082849515
Do you get the error everytime?
yes I get it everytime...

Regards
_Linux_Learner
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 09:30 PM
LXer: Review: Programming in Python 3: A Complete Introduction to the Python Language LXer Syndicated Linux News 0 01-26-2009 05:50 AM
Problem with Python code under Linux dmsynck Programming 1 10-25-2007 11:18 PM
LXer: Move to python 2.4 / Changing the packaging style for python packages LXer Syndicated Linux News 0 06-13-2006 08:54 PM
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 12:05 PM


All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration