While working on another shelve issue I noticed that the keyencoding keyword argument was added to shelf, but that the value is hardcoded to 'utf-8' in the __init__ body. DbfilenameShelf does not have a keyencoding option, nor does open, but BsdDbShelf does. It seems to me that keyencoding was intended to be exposed but the work was not completed. However I could be wrong...in which case the module should probably just use sys.getdefaultencoding. I've prepared a patch that fixes the hardcoding bug and adds docs for the places where the keyword argument is currently accepted. If this argument is kept and is documented, it should presumably be added to DbfilenameShelf and open as well.
One remark: In “The *keyencoding* parameter is the encoding used to encode key values”, what are “key values”? Don’t we just say “keys” in such cases? Regards