You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mismatching results when running an asyncio script with Python 3.5.0 and aiocontextvars vs. Python 3.7.5rc1 and native contextvars package.
What I Did
I created a virtual environment with Python 3.5.0 and installed aiocontextvars via pip3. I activated the virtual environment and ran the script below. I ran the same script with Python 3.7.5rc1 and got different results. The results that I got from running with Python 3.7.5rc1 are the ones I expected. When I run the script with aiocontextvars it seems like the ContextVar value is not kept independently for the different async functions that set its value.
(3-5-0) ocelotl@harrison:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
(3-5-0) ocelotl@harrison:~$ python3 --version
Python 3.5.0
(3-5-0) ocelotl@harrison:~$ pip3 freeze
aiocontextvars==0.2.2
contextvars==2.4
immutables==0.11
You are using pip version 7.1.2, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(3-5-0) ocelotl@harrison:~$ python3 async_contextvar.py
async_name: A
local_name: A
async_name: B
local_name: B
async_name: A
local_name: B
async_name: C
local_name: C
async_name: C
local_name: C
async_name: B
local_name: C
(3-5-0) ocelotl@harrison:~$
ocelotl@harrison:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
ocelotl@harrison:~$ python3 --version
Python 3.7.5rc1
ocelotl@harrison:~$ python3 async_contextvar.py
async_name: A
local_name: A
async_name: B
local_name: B
async_name: A
local_name: A
async_name: C
local_name: C
async_name: C
local_name: C
async_name: B
local_name: B
ocelotl@harrison:~$
The text was updated successfully, but these errors were encountered:
Description
Mismatching results when running an
asyncio
script with Python 3.5.0 and aiocontextvars vs. Python 3.7.5rc1 and native contextvars package.What I Did
I created a virtual environment with Python 3.5.0 and installed aiocontextvars via
pip3
. I activated the virtual environment and ran the script below. I ran the same script with Python 3.7.5rc1 and got different results. The results that I got from running with Python 3.7.5rc1 are the ones I expected. When I run the script with aiocontextvars it seems like theContextVar
value is not kept independently for the differentasync
functions that set its value.The text was updated successfully, but these errors were encountered: