Environment data
- debugpy version: 1.8.9
- OS and version: linux ubuntu 22.04 host via ssh via docker devcontainer (nvidia/cuda:12.1.1-runtime-ubuntu22.04)
- Python version: uv, python 3.12.8
- Using VS Code or Visual Studio: vscode 1.96.3
Actual behavior
getting unclosed socket warning only when running via debbuger (only extension installed is python + pylance + debugpy):
Exception ignored in: <socket.socket fd=5, family=2, type=1, proto=0, laddr=('127.0.0.1', 57946), raddr=('127.0.0.1', 33845)>
ResourceWarning: unclosed <socket.socket fd=5, family=2, type=1, proto=0, laddr=('127.0.0.1', 57946), raddr=('127.0.0.1', 33845)>
Expected behavior
should not pop
Steps to reproduce:
here is a full code repro:
importtimeimportwarningsfrommultiprocessingimportProcess, set_start_methodwarnings.filterwarnings("error")
defscript_runner():
defdecorate(func):
defwrapper(*args, **kwargs):
set_start_method("spawn")
func(*args, **kwargs)
returnwrapperreturndecorate@script_runner()defmain():
processes= [Process(target=worker_function, args=(f"Worker-{i}",)) foriinrange(5)]
# Start all processesforprocessinprocesses:
process.start()
# Wait for all processes to completeforprocessinprocesses:
process.join()
print("All processes have completed.")
defworker_function(name: str) ->None:
print(f"Process {name} is starting")
time.sleep(2) # Simulate workprint(f"Process {name} has finished")
if__name__=="__main__":
# Create multiple processesmain()output:
Process Worker-2 is starting
Process Worker-0 is starting
Process Worker-3 is starting
Process Worker-1 is starting
Process Worker-2 has finished
Process Worker-4 is starting
Process Worker-0 has finished
Exception ignored in: <socket.socket fd=5, family=2, type=1, proto=0, laddr=('127.0.0.1', 57916), raddr=('127.0.0.1', 33845)>
ResourceWarning: unclosed <socket.socket fd=5, family=2, type=1, proto=0, laddr=('127.0.0.1', 57916), raddr=('127.0.0.1', 33845)>
Process Worker-3 has finished
Exception ignored in: <socket.socket fd=5, family=2, type=1, proto=0, laddr=('127.0.0.1', 57946), raddr=('127.0.0.1', 33845)>
ResourceWarning: unclosed <socket.socket fd=5, family=2, type=1, proto=0, laddr=('127.0.0.1', 57946), raddr=('127.0.0.1', 33845)>
Process Worker-1 has finished
Process Worker-4 has finished
All processes have completed.
Environment data
Actual behavior
getting unclosed socket warning only when running via debbuger (only extension installed is python + pylance + debugpy):
Expected behavior
should not pop
Steps to reproduce:
here is a full code repro:
output: