New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in dbm - long strings in keys and values #39439
Comments
#!/usr/local/bin/python
python/issues-test-cpython#2003-10-19. Feedback to crunch@shopip.com
import dbm print """
This demonstrates serious bugs in the Python dbm len(key+string)>61231 results in the item being 'lost', Curiously, keys of length 57148 return an error, but mdb=dbm.open("mdb","n")
print "Writing 1 item to database, but upon reading,"
k='k'
v='X'*61230 #Long string
mdb[k]=v
mdb.close()
md=dbm.open("mdb","r")
print "database contains %i items"%len(md.keys())
md.close() |
Logged In: YES I upped the priority since this bug causes dbm database |
Logged In: YES Hi! This is no bug - at least no python bug. I tested it with different dbm implementations under Linux I also tested without Python, i. e. just using the C-API and Context: drec=dbm_firstkey(dbm);
while(drec.dptr) {
size++;
drec = dbm_nextkey(dbm);
} If you happen to have a system that uses gdbm/ndbm.h as If possible change to gdbm or assure that dbm is linked ldd /usr/local/lib/python2.3/lib-dynload/dbm.so shows you what lib you're using. On my Debian system an Ciao Tino |
Logged In: YES I'm closing this as a third-party bug. If there is any |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: