ResourceWarning: unclosed socket
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Issue
If i run python with warnings enabled (set the env var PYTHONWARNINGS="default"
), and try to do poetry update
or any remote connection related operation i get the following message:
C:\Users\<username>\.poetry\lib\poetry\console\application.py:54: ResourceWarning: unclosed <ssl.SSLSocket fd=868, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('157.163.199.78', 57798), raddr=('151.101.192.223', 443)>
self._poetry = None
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Poetry version 1.0.5 Python 3.8.2 x64 Windows 10
Update: added the fuller message with the location of the warning in code: C:\Users\<username>\.poetry\lib\poetry\console\application.py:54:
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
ResourceWarning unclosed socket in Python 3 Unit Test
I'm modifying some code to be compatible between Python 2 and Python 3 , but have observed a warning in unit test output....
Read more >unclosed socket.socket when I run a unittest? · Issue #3912 ...
This warning happens because Requests uses a keep-alive model that means we try not to explicitly close sockets in many cases. Exactly why...
Read more >ResourceWarning: unclosed <socket.socket [closed] fd=3 ...
_socket.socket object destructor emits a ResourceWarning if the socket is not closed. The problem is this warning: build/Lib/contextlib.py:60: ...
Read more >[PYTHON-2338] _RttMonitor causes ResourceWarning
Noticed this ResourceWarning for an unclosed socket while running the tests. The ResourceWarning seem to randomly occur throughout the test ...
Read more >ResourceWarning unclosed socket in Python 3 Unit Test
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/case.py:601: ResourceWarning: unclosed socket.socket fd=4, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The fix works for me with Poetry (version 1.2.0a2) and Python 3.10
Perfect, thank you. I will apply and test it locally in the evening.
On Fri, 15 Oct 2021, 13:11 Kevin Kirsche @.***> wrote: