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 zd nex
Recipients dorosch, zd nex
Date 2020-03-20.06:57:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584687446.42.0.250665047002.issue39672@roundup.psfhosted.org>
In-reply-to
Content
Hello,

so I was trying to figure out where actually is problem is. As I do not think it is in shelve itself. So I have made different method for __setitem__ on shelve and I have found that it is actually in pickle.dump >

Here is code which I have used

def __setitem__(self, key, value):
    if self.writeback:
        self.cache[key] = value
    f = BytesIO()
    print("set")
    p = pickle.Pickler(f, self._protocol)
    try: 
        print("before dumps - > crash",value)
        p.dump(value)
        print("after dump > will not be printed on crash")
    except Exception as e:
        print("error set",e)
    print("after dump",key)
    self.dict[key.encode(self.keyencoding)] = f.getvalue()
    print("saved")

When in this code user changes p.dump to another method cpython crash does not happen. Can you please try to see if it is like that?
History
Date User Action Args
2020-03-20 06:57:26zd nexsetrecipients: + zd nex, dorosch
2020-03-20 06:57:26zd nexsetmessageid: <1584687446.42.0.250665047002.issue39672@roundup.psfhosted.org>
2020-03-20 06:57:26zd nexlinkissue39672 messages
2020-03-20 06:57:26zd nexcreate