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 uriyyo
Recipients uriyyo
Date 2021-01-03.11:43:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org>
In-reply-to
Content
New thread doesn't copy context of the parent thread.

The minimal example to reproduce the issue:
```
from threading import Thread
from contextvars import ContextVar

foo: ContextVar[str] = ContextVar("foo")


def temp():
    print(foo.get())


foo.set("bar")

t = Thread(target=temp)
t.start()
t.join()
```

Is it expected behavior?

PEP 567 I didn't find anything regarding this case.
History
Date User Action Args
2021-01-03 11:43:34uriyyosetrecipients: + uriyyo
2021-01-03 11:43:34uriyyosetmessageid: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org>
2021-01-03 11:43:34uriyyolinkissue42815 messages
2021-01-03 11:43:34uriyyocreate