[Python-bugs-list] [ python-Bugs-800824 ] test_dumbdbm failing

SourceForge.net noreply at sourceforge.net
Sun Sep 7 14:44:14 EDT 2003


Bugs item #800824, was opened at 2003-09-05 04:02
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800824&group_id=5470

Category: Python Library
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Brett Cannon (bcannon)
Assigned to: Martin v. Löwis (loewis)
Summary: test_dumbdbm failing

Initial Comment:
Getting the following failures:



test_close_twice (__main__.DumbDBMTestCase) ... ok

test_dumbdbm_creation (__main__.DumbDBMTestCase) ... 

ok

test_dumbdbm_keys (__main__.DumbDBMTestCase) ... 

ERROR

test_dumbdbm_modification (__main__.DumbDBMTestCase) 

... ERROR

test_dumbdbm_read (__main__.DumbDBMTestCase) ... 

ERROR

test_random (__main__.DumbDBMTestCase) ... ERROR

test_write_write_read (__main__.DumbDBMTestCase) ... 

ERROR





They all error out with the same problem:



Traceback (most recent call last):

  File "Lib/test/test_dumbdbm.py", line 73, in 

test_write_write_read

    f = dumbdbm.open(_fname)

  File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/

dumbdbm.py", line 232, in open

    return _Database(file, mode)

  File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/

dumbdbm.py", line 73, in __init__

    self._update()

  File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/

dumbdbm.py", line 84, in _update

    key, pos_and_siz_pair = eval(line)

TypeError: expected string without null bytes





test_whichdb is also failing for essentially the same reason 

although it is hidden under some executed code:



test_whichdb_dbm (__main__.WhichDBTestCase) ... ok

test_whichdb_dumbdbm (__main__.WhichDBTestCase) ... 

FAIL



=====================================

=================================

FAIL: test_whichdb_dumbdbm (__main__.WhichDBTestCase)

--------------------------------------------------------------------

--

Traceback (most recent call last):

  File "Lib/test/test_whichdb.py", line 56, in 

test_whichdb_name

    self.assertEqual(name, whichdb.whichdb(_fname))

  File "/Users/drifty/Progs/Python/CVS/python/dist/src/Lib/

unittest.py", line 292, in failUnlessEqual

    raise self.failureException, \

AssertionError: 'dumbdbm' != None





If I run the test by hand by copy-n-paste in the interpreter I 

get the same error as above about null bytes.



Now I compile with --enable-unicode=ucs4, if that has 

anything to do with it.



This is all on OS X 10.2.6 .

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-09-07 22:44

Message:
Logged In: YES 
user_id=21627

This is now fixed in fileobject.c 2.183 and 2.179.8.2.



The bug was triggered by a bug in dumbdbm: the mode argument

does not actually define the file mode, but the buffer size...

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-09-06 06:52

Message:
Logged In: YES 
user_id=80475

Martin, this appears to be caused by your recent patch to 

fileobject.c and fileobject.h.



FYI, it only fails when run with python_d.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=800824&group_id=5470



More information about the Python-bugs-list mailing list