[Python-bugs-list] tell() returning long (PR#37)

pm@webhosting.com pm@webhosting.com
Wed, 28 Jul 1999 12:12:09 -0400 (EDT)

Full_Name: Paul Mokbel
Version: 1.5.2
OS: FreeBSD 3.2
Submission from: (NULL) (

Here is some snippet of code:
>>> import anydbm
>>> file = anydbm.open('temp', 'c')
>>> file['asdsa'] = '21'
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python1.5/dumbdbm.py", line 112, in __setitem__
    (pos, siz) = self._addval(val)
  File "/usr/local/lib/python1.5/dumbdbm.py", line 87, in _addval
    f.write('\0' * ( npos - pos))
TypeError: can't multiply sequence with non-int

There is definitly a problem here... On my machine, and on three similar
machines, I have tried it and on all tell() returns a long int, and not an int
that dumbdbm expected.
It tries to multiply '\0' by a long int..  Here is some more proof:

>>> file = open('.login')
>>> file.tell()
>>> file.seek(2,0)
>>> file.tell()

Definitly a problem with tell()..

.. I have checked the database for similar bugs and have not seen any of this,
(maybe I am missing something).

Paul M