file.tell() -- obscure IOError
Uwe Mayer
merkosh at hadiko.de
Fri Jun 14 22:39:37 EDT 2002
In article <MPG.1774c0f11ff79749989686 at news.rz.uni-karlsruhe.de>,
merkosh at hadiko.de says...
> hi,
>
> i have an object which conforms to the file protocoll. while calling the
> self.file.tell() method, i get the following error message:
>
> >>> s1 == s2
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "riff.py", line 153, in __cmp__
> data1 = self.read(self.value.step)
> File "riff.py", line 205, in read
> maxsize = len(self) -self.tell()
> File "riff.py", line 234, in tell
> return self.file.tell() -self.value.start
> IOError: (0, 'Error')
>
more info:
the tell() does not fail every time. what i do:
i compare two files by reading count bytes and calling cmp() on both of
them until end of file or cmp() != 0
the tell() failes for different numbers of 'count' bytes. f.e.
count = 1 fails after 7 bytes
count = 5 works
count = 6 fails right at the beginning
...?
any ideas?
Ciao
Uwe
More information about the Python-list
mailing list