Almenon / AREPL-vscode

Program python in real-time
MIT License
267 stars 33 forks source link

Exception ignored in: <function BaseEventLoop.__del__ ...> #451

Open ptsl opened 1 year ago

ptsl commented 1 year ago

Bug: A strange traceback is produced with syntactically correct Python code.

How to reproduce: Sometimes I type in a syntactically valid Python code (which ends with print(vars(myobj)) and the following traceback is produced. To get rid of the traceback, I just type any key (which makes the code syntactically incorrect), delete it with Backspace and whoa - the traceback disappears.

Traceback:

Exception ignored in: <function BaseEventLoop.__del__ at 0x7fdf013c12d0>
Traceback (most recent call last):
  File "/build/vw-master-native-gen5-gcc11-linux-server-mm-dev-master/lib/python3.10/asyncio/base_events.py", line 688, in __del__
    _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
Exception ignored in: <socket.socket fd=6, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Traceback (most recent call last):
  File "/home/me/.vscode/extensions/almenon.arepl-2.0.5/node_modules/arepl-backend/python/arepl_python_evaluator.py", line 243, in exec_input
    run_context.run(exec, exec_args.evalCode, eval_locals)
ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <socket.socket fd=7, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Traceback (most recent call last):
  File "/home/me/.vscode/extensions/almenon.arepl-2.0.5/node_modules/arepl-backend/python/arepl_python_evaluator.py", line 243, in exec_input
    run_context.run(exec, exec_args.evalCode, eval_locals)
ResourceWarning: unclosed <socket.socket fd=7, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <function BaseEventLoop.__del__ at 0x7fdf013c12d0>
Traceback (most recent call last):
  File "/build/vw-master-native-gen5-gcc11-linux-server-mm-dev-master/lib/python3.10/asyncio/base_events.py", line 688, in __del__
    _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
Exception ignored in: <socket.socket fd=18, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Traceback (most recent call last):
  File "/home/me/.vscode/extensions/almenon.arepl-2.0.5/node_modules/arepl-backend/python/arepl_python_evaluator.py", line 243, in exec_input
    run_context.run(exec, exec_args.evalCode, eval_locals)
ResourceWarning: unclosed <socket.socket fd=18, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <socket.socket fd=19, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Traceback (most recent call last):
  File "/home/me/.vscode/extensions/almenon.arepl-2.0.5/node_modules/arepl-backend/python/arepl_python_evaluator.py", line 243, in exec_input
    run_context.run(exec, exec_args.evalCode, eval_locals)
ResourceWarning: unclosed <socket.socket fd=19, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>

Other Information (please complete the following information):

Almenon commented 1 year ago

wierd..... never seen that one before. Might be fixed by https://github.com/Almenon/AREPL-vscode/issues/439

ptsl commented 1 year ago

In the meanwhile... does AREPL produce a log or something that I could send in to help understand the issue?

ptsl commented 1 year ago

I've also noticed that in:

from arepl_dump import dump

the identifier arepl_dump is not resolved, that is, it is underlined with a red wobbly line. Could it be connected to the problem somehow? (It definitely means that VSCode cannot see some stuff it should see.)

Almenon commented 1 year ago

No log. If you want, you could try different versions of python and see what happens.

I've also noticed

No, not connected. The VSCode python extension doesn't like arepl_dump because it's unaware that it's available in the context of AREPL. You can ignore the error.

Almenon commented 2 weeks ago

This might be fixed if you update AREPL to v3 :)

If it's not fixed can you send me the code that reproduces the issue please?

ptsl commented 1 week ago

Hi, thank you for the update and for your work on AREPL!

I’m not working with Python much at the moment, but when I get back to Python programming, I'll definitely let you know if I encounter the issue again.

Thanks again for all your hard work!