472,951 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Need help for the error "OverflowError: long int too large to convert to int"


Need help for the error "OverflowError: long int too large to convert to int" while reading a zip file content.
Python version:
Python 2.4.1 (#1, Sep 13 2005, 00:39:20)
[GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2

>>> import os, datetime, sys, optparse, string, operator, gzip
>>> health_day_summary_file = gzip.GzipFile( "health_CORR_summary.csv.gz", "rb")
>>> lot_source_contents = health_day_summary_file.readlines()

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/gzip.py", line 413, in readlines
line = self.readline()
File "/usr/lib/python2.4/gzip.py", line 387, in readline
c = self.read(readsize)
File "/usr/lib/python2.4/gzip.py", line 224, in read
File "/usr/lib/python2.4/gzip.py", line 265, in _read
buf = self.fileobj.read(size)
OverflowError: long int too large to convert to int

Thanks in advance
Aug 27 '07 #1
1 4269
6,596 Expert 4TB
Looks likehealth_day_summary_file is not a text file.

file.readlines() is for reading newline terminated text into a list of newline terminated strings.
Aug 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Num | last post by:
Hi all, I have to convert a J2EE date as a long ("Millis") in a .NET date as a long ("Ticks") In Java, currentTimeMillis, is the difference, measured in milliseconds, between the current time...
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
by: ondekoza | last post by:
Hello, I need to convert the string "FFFFFFFF" to a long. To convert this string I tried the following: >>> 0xffffffff -1 >>> 0xffffffffL 4294967295L OK, this is what I want, so I tried
by: Zero | last post by:
Hi everybody, i want to write a small program, which shows me the biggest and smallest number in dependance of the data type. For int the command could be: ...
by: nineoo | last post by:
To all, Ok , now this may sound a little crazy, but does any one know if there is a way to increase the maximum value of a unsigned long int? I'm aware of the the max value of an...
by: Jo Deni | last post by:
Folks, I'm a newbie here (and with C++). While executing a C++ program I'm getting the following message error: integer constant is too large for "long" type and here is the offending line...
by: Warly girl | last post by:
Hi i want your help again in c++ !! i want a function change the "int" to "string" because in my project "Registration system" in task "b" i must write a course class which contains number of...
by: tekctrl | last post by:
Anyone: I have a simple MSAccess DB which was created from an old ASCII flatfile. It works fine except for something that just started happening. I'll enter info in a record, save the record,...
by: vippstar | last post by:
Assuming all the values of int are in the range of unsigned char, what happends if getc returns EOF? Is it possible that EOF was the value of the byte read? Does that mean that code aiming for...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.