<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi there,<br>
<br>
The patch you provided works great, thanks!<br>
<br>
David Mason<br>
<br>
Robey Pointer wrote:
<blockquote cite="midA283A90F-B900-4F49-8CB0-B3CCB2A654BA@lag.net"
 type="cite">
  <pre wrap="">On 23 Nov 2006, at 15:42, David Mason wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi again,

Yesterday I asked about a "bad file descriptor" error that was  
coming up as I was closing the SSH connection.  After some digging  
I determined that it was happening due to the thread not picking up  
that it is inactive until some time after the sockets are closed.   
I've fixed this by making the close method in Transport wait for  
the thread to terminate *before* it closes the open connection.   
I've attached a patch that fixes this behaviour (text of patch is  
also listed below).
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Joining the thread before the packetizer is closed may cause the  
packetizer to never realize that it should stop, though.  (The unit  
tests break for this reason -- good demonstration of why they're  
actually useful!) :)

I think a better fix would be to notice when a socket.error happens  
because of EOF, and translate the exception.  Patch below -- does  
this fix it for you too?

robey


=== modified file 'paramiko/packet.py'
--- paramiko/packet.py  2006-11-12 06:30:54 +0000
+++ paramiko/packet.py  2006-11-27 19:13:31 +0000
@@ -218,6 +218,8 @@
                  # we need to work around it.
                  if (type(e.args) is tuple) and (len(e.args) &gt; 0)  
and (e.args[0] == errno.EAGAIN):
                      got_timeout = True
+                elif self.__closed:
+                    raise EOFError()
                  else:
                      raise
              if got_timeout:


_______________________________________________
paramiko mailing list
<a class="moz-txt-link-abbreviated" href="mailto:paramiko@lag.net">paramiko@lag.net</a>
<a class="moz-txt-link-freetext" href="http://www.lag.net/mailman/listinfo/paramiko">http://www.lag.net/mailman/listinfo/paramiko</a>
  </pre>
</blockquote>
</body>
</html>