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 Paul Ellenbogen
Recipients Paul Ellenbogen, jnoller, sbt
Date 2016-04-17.17:28:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460914096.07.0.170314253319.issue26773@psf.upfronthosting.co.za>
In-reply-to
Content
I think this behavior is due to the underlying behavior of the dbm. The same code using dbm, rather than shelve, also throws KeyErrors:

from multiprocessing import Process
import dbm

db = dbm.open("example.dbm", "c")
for i in range(100):
    db[str(i)] = str(i ** 2)


def parallel():
    for i in range(100):
        print(db[str(i)])

a = Process(target = parallel)
b = Process(target = parallel)
a.start()
b.start()
a.join()
b.join()
History
Date User Action Args
2016-04-17 17:28:16Paul Ellenbogensetrecipients: + Paul Ellenbogen, jnoller, sbt
2016-04-17 17:28:16Paul Ellenbogensetmessageid: <1460914096.07.0.170314253319.issue26773@psf.upfronthosting.co.za>
2016-04-17 17:28:16Paul Ellenbogenlinkissue26773 messages
2016-04-17 17:28:16Paul Ellenbogencreate