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 vstinner
Recipients Arfrever, neologix, pitrou, tim.peters, vstinner
Date 2013-11-28.01:24:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Oh, here is in interesting commit:
changeset:   33705:891042c94aed
branch:      legacy-trunk
user:        Tim Peters <>
date:        Sat Oct 09 22:33:09 2004 +0000
files:       Python/thread.c
Document the results of painful reverse-engineering of the "portable TLS"

PyThread_set_key_value():  It's clear that this code assumes the passed-in
value isn't NULL, so document that it must not be, and assert that it
isn't.  It remains unclear whether existing callers want the odd semantics
actually implemented by this function.

Here is a patch adding a _PyThread_set_key_value() function which behaves as I expected.

It looks like PyThread_set_key_value() got its strange behaviour from the find_key() of Python/thread.c.

Don't hesistate if you have a better suggestion for the name if the new function :-)

Another option is to modify directly the existing function, but it might break applications relying on the current (weird) behaviour.
Date User Action Args
2013-11-28 01:25:05vstinnersetrecipients: + vstinner, tim.peters, pitrou, Arfrever, neologix
2013-11-28 01:25:04vstinnersetmessageid: <>
2013-11-28 01:25:04vstinnerlinkissue19787 messages
2013-11-28 01:25:03vstinnercreate