ipdb `with launch_ipdb_on_exception():` gives pylint E1129 error mesage
I am using: ipdb==0.13.9
For the code-block from answer for Launch an IPython shell on exception
from ipdb import launch_ipdb_on_exception
with launch_ipdb_on_exception():
main()
I am getting following warning message:
[not-context-manager] Context manager 'generator' doesn't implement __enter__ and __exit__. [E1129]
How could I prevent this warning message?
Which versions of Python and IPython ?
Python==3.8.10. I am not using IPython .
Well, if you use ipdb, you use IPython because it is a dependency. Can you check which version has been installed ?
I do not see that warning when running with Python 3.8.8 and IPython 8.0.1.
Could it be related to pylint ?
see https://github.com/PyCQA/pylint/issues/782
ipdb==0.13.9
pylint==2.12.2
```
`pip freeze | grep IPython` returns empty.
how did you install ipdb ? Are you in conda or jupyter or another environment ?
The way I install pip install ipdb -U.
I am using just pure python, I am not using conda or jupyter or anything else.
I have os.environ["PYTHONBREAKPOINT"] = "0" in my python code and I just add breakpoint() # DEBUG into my code.
When you install ipdb with pip like you describe above, it also installs IPython.
Do you know how to check which version got installed ?
Do you use virtualenv or venv or bare python ?
I am using venv, created as follows:
VENV=$HOME/venv
python3 -m venv $VENV
source $VENV/bin/activate
Ah there is ipython installed, I had not idea it exists.
$ ipython
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.27.0 -- An enhanced Interactive Python. Type '?' for help.
Sorry for the delayed answer. I missed your post.
Did you try with a more recent IPython ?
pip install ipython==8.7.0 in your venv
@avatar-lavventura Just for my information, did this actually solve your issue ?
Or you are being polite when I answered so late and you did not have a need for a solve anymore ?
I was polite as well :) But when I asked the question I believe latest version for ipython was 7.27.0. When I updated the ipython version, it is solved my issue.