Open iamlikeme opened 5 months ago
Interesting! Thanks for the report, @iamlikeme. We'll check it out.
I encountered same issue when navigating with tmate in Ipython shell console
In [1]: ls
/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py:1207: RuntimeWarning: coroutine 'Application.run_async.<locals>._run_async.<locals>.auto_flush_input' was never awaited
await asyncio.wait(
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
CONTRIBUTING.md Pipfile.lock certificates/ scripts/ tests/
Dockerfile README.md docker/ locale/ pylintrc setup.cfg uwsgi-json.ini
Pipfile manage.py* pytest.ini templates/ uwsgi.ini
/usr/local/lib/python3.11/site-packages/prompt_toolkit/key_binding/key_processor.py:413: RuntimeWarning: coroutine 'KeyProcessor._start_timeout.<locals>.wait' was never awaited
self._flush_wait_task = app.create_background_task(wait())
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
When i downgraded ddtrace from 2.8.2 to 2.7.2 it resolved my issues. (2.7.10 is good too, 2.8.0 breaks)
I tried turning on python tracemalloc stuff via env var, then written error changed itself to
In [1]:
/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py:1207: RuntimeWarning: coroutine 'Application.run_async.<locals>._run_async.<locals>.auto_flush_input' was never awaited
await asyncio.wait(
Object allocated at (most recent call last):
File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py", lineno 704
flush_task = self.create_background_task(auto_flush_input())
/usr/local/lib/python3.11/site-packages/prompt_toolkit/key_binding/key_processor.py:413: RuntimeWarning: coroutine 'KeyProcessor._start_timeout.<locals>.wait' was never awaited
self._flush_wait_task = app.create_background_task(wait())
Object allocated at (most recent call last):
File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/key_binding/key_processor.py", lineno 413
self._flush_wait_task = app.create_background_task(wait())
pip version 24.0
Confirming that solution DD_TRACE_ASYNCIO_ENABLED=false python3 manage.py shell
helped me too.
I have the same issues too.
Summary of problem
IPython produces RuntimeWarning on each tab-completion and enter when ddtrace's
asyncio
integration is active.Which version of dd-trace-py are you using?
2.8.0
Which version of pip are you using?
24.0
Which libraries and their versions are you using?
`pip freeze`
asttokens==2.4.1 attrs==23.2.0 bytecode==0.15.1 cattrs==23.2.3 ddsketch==3.0.1 ddtrace==2.8.0 decorator==5.1.1 Deprecated==1.2.14 envier==0.5.1 executing==2.0.1 importlib-metadata==7.0.0 ipython==8.23.0 jedi==0.19.1 matplotlib-inline==0.1.6 opentelemetry-api==1.24.0 parso==0.8.4 pexpect==4.9.0 prompt-toolkit==3.0.43 protobuf==5.26.1 ptyprocess==0.7.0 pure-eval==0.2.2 Pygments==2.17.2 setuptools==69.2.0 six==1.16.0 sqlparse==0.4.4 stack-data==0.6.3 traitlets==5.14.2 typing_extensions==4.11.0 wcwidth==0.2.13 wrapt==1.16.0 xmltodict==0.13.0 zipp==3.18.1How can we reproduce your problem?
In an IPython REPL:
The problem disappears when
asyncio
integration is deactivated:What is the result that you get?
I see RuntimeWarnings on every enter and tab-completion in IPython.
What is the result that you expected?
I expected to see no RuntimeWarnings :slightly_smiling_face: