[docs] [issue23174] shelve.open fails with error "anydbm.error: db type could not be determined"

Karl Richter report at bugs.python.org
Tue Jan 6 02:58:55 CET 2015


Karl Richter added the comment:

Then, let the error message say "You are opening a just-created empty file.  The db type of the file cannot, therefore, be determined." which is much clearer than "anydbm.error: db type could not be determined" which sounds like a generic fallback error message in "an error occured"-style.

It seems to be necessary that the filename passed to `shelve.open` has a suffix which is not very intuitive for Linux users. It'd be great to have validation of the suffix and raise a `ValueError` with an error message like `"filename '%s' doesn't contain a suffix" % (filename,)` when it isn't supplied. If there's another issue regarding the fact that the file is "just-created" and empty, this is independent of the issue above.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23174>
_______________________________________


More information about the docs mailing list