[Image-SIG] OverflowError: long int to large to convert to int

Bernd Prager bernd at prager.ws
Fri Feb 10 23:28:29 CET 2006

Ok, trying to nail the issue down I changed the Python version under Linux.

Here's the program:
------ snip -------------------
import sys
import PIL.OleFileIO

filename = "outl.msg"
ole = PIL.OleFileIO.OleFileIO(filename)
for entry in ole.listdir():
    print entry[1:2]
------ snip -------------------
When I run this program with python2.3 I get following output:

/usr/lib/python2.3/site-packages/PIL/OleFileIO.py:46: FutureWarning: x<<y
losing bits or changing sign will return a long in Python 2.4 and up
  return ord(c[o])+(ord(c[o+1])<<8)+(ord(c[o+2])<<16)+(ord(c[o+3])<<24)

But when I run this script with python2.4 I get:

Traceback (most recent call last):
  File "./test.py", line 7, in ?
    ole = PIL.OleFileIO.OleFileIO(filename)
  File "/usr/lib/python2.4/site-packages/PIL/OleFileIO.py", line 260, in
  File "/usr/lib/python2.4/site-packages/PIL/OleFileIO.py", line 289, in open
  File "/usr/lib/python2.4/site-packages/PIL/OleFileIO.py", line 309, in
    s = self.getsect(ix)
  File "/usr/lib/python2.4/site-packages/PIL/OleFileIO.py", line 324, in
    self.fp.seek(512 + self.sectorsize * sect)
IOError: [Errno 22] Invalid argument

Any clues?
Thanks for help,
-- Bernd

More information about the Image-SIG mailing list