This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gardener.willy
Recipients gardener.willy
Date 2020-12-17.11:05:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608203117.3.0.00404135488038.issue42667@roundup.psfhosted.org>
In-reply-to
Content
Shelve module uses "import dbm" instruction while opening database. Dbm module has global dictionary "_modules". This dictionary modifies during database opening operation. When different threads simultaneously try to open different databases, unexpected behavior occurred. In my case I've got such message: 

    with shelve.open('some_file') as f:
  File "/usr/local/lib/python3.6/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/usr/local/lib/python3.6/shelve.py", line 227, in init
    Shelf.init(self, dbm.open(filename, flag), protocol, writeback)
  File "/usr/local/lib/python3.6/dbm/__init__.py", line 94, in open
    return mod.open(file, flag, mode)
AttributeError: module 'dbm.ndbm' has no attribute 'open'

Behavior is the same on python 3.6 and 3.7. Error is spontaneous.
History
Date User Action Args
2020-12-17 11:05:17gardener.willysetrecipients: + gardener.willy
2020-12-17 11:05:17gardener.willysetmessageid: <1608203117.3.0.00404135488038.issue42667@roundup.psfhosted.org>
2020-12-17 11:05:17gardener.willylinkissue42667 messages
2020-12-17 11:05:17gardener.willycreate