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 zaneb
Recipients Chris Barth, JelleZijlstra, Trundle, berker.peksag, serhiy.storchaka, zaneb
Date 2017-10-16.22:44:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508193868.87.0.213398074469.issue28603@psf.upfronthosting.co.za>
In-reply-to
Content
I also encountered this issue, and I'd like to further note that it is extraordinarily difficult to debug without access to stderr. If your logging facility uses the traceback module then it will be unable to record both the original (unhashable) exception, and the TypeError that it triggers (since the original exception is its __context__). The effect is that execution of a thread appears to simply stop without rhyme or reason (in fact it is still executing, but that fact is not apparent from the logs). I'm attaching a short reproducer that demonstrates this effect.

I believe the trade-offs inherent in the attached patches (either stopping the chain at an unhashable exception, or using a less-efficient data structure) can be avoided by comparing for identity rather than equality. The purpose of the check is to avoid an infinite loop; whether the objects compare as equal is something that is up to the author of the class, and has no relevance here except insofar as that objects ought to compare equal to themselves.

I submitted a pull request (#4014) with an implementation of that.
History
Date User Action Args
2017-10-16 22:44:28zanebsetrecipients: + zaneb, Trundle, berker.peksag, serhiy.storchaka, JelleZijlstra, Chris Barth
2017-10-16 22:44:28zanebsetmessageid: <1508193868.87.0.213398074469.issue28603@psf.upfronthosting.co.za>
2017-10-16 22:44:28zaneblinkissue28603 messages
2017-10-16 22:44:28zanebcreate