471,330 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 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 4132
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

Post your reply

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

Similar topics

16 posts views Thread by ondekoza | last post: by
12 posts views Thread by Zero | last post: by
25 posts views Thread by tekctrl | last post: by
32 posts views Thread by vippstar | last post: by
reply views Thread by rosydwin | last post: by

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.