Repository navigation
Conversation
As mentioned in socket docs: "Sockets are automatically closed when they are garbage-collected, but it is recommended to close() them explicitly, or to use a with statement around them." Resolve paramiko#1126
|
Does every |
all this code runs under a condition the sock wasn't provided, so it muse be a socket created by The scenario I encounter was when when errno=EHOSTUNREACH but sock.close() looks enough safe to call on any socket.error. |
|
What's the status of this? |
|
@dominiclondon It's been idle, with other paramiko/fabric/invoke matters taking higher priority in bitprophet's weekly OSS allotment. Thanks for bumping it to indicate your interest in it, I've now triaged it. |
|
May partially address #1127, per #1126 (comment). #1127 (comment) also references #964 and #949. Significant discussion in #949; #891 mentioned in passing, with appreciable discussion around #44, #952 (2017 era). #964 (comment) (also 2017) cross-references #367 #440 #441. #964 (comment) (2019 era) suggests some other changes within/without(?) paramiko may have (partly?) helped the problem. |
|
Thanks all. Merged this and wrote a quick test for it (😩). Does look like a lot of the other related tickets @bskinn dug up (👍🏻✨) aren't completely solved by this, but it'll still help with a subset for sure. Closed the one other that seemed like a full-on duplicate. Cherry picked to 2.8 and up, in case any of those get more bugfix releases. |
As mentioned in socket docs:
"Sockets are automatically closed when they are garbage-collected, but it is recommended to close() them explicitly, or to use a with statement around them."
Resolve #1126