Comment 12 for bug 255292

Revision history for this message
Andrew Bennetts (spiv) wrote :

I replied to cash5's comment (comment #10) via private email, as that's where I initially received it. For the benefit of other people reading this bug, here's my reply:

"""
Neither. I want to know what the bad SFTP packet sent over the network looks
like.

If you are comfortable with debugging Python, then you could perhaps set
BZR_PDB=1 in your environment to get a pdb prompt when this error happens, and
then see if you can find out what the last bytes read by paramiko were.

Or perhaps just edit your install of bzr to display a more information when this
happens. E.g. apply a patch like:

=== modified file 'bzrlib/transport/ssh.py'
--- bzrlib/transport/ssh.py 2008-04-24 07:22:53 +0000
+++ bzrlib/transport/ssh.py 2008-08-14 06:20:41 +0000
@@ -602,7 +602,11 @@
         return os.write(self.proc.stdin.fileno(), data)

     def recv(self, count):
- return os.read(self.proc.stdout.fileno(), count)
+ try:
+ return os.read(self.proc.stdout.fileno(), count)
+ except:
+ print '** Error occurred reading %r bytes' % (count,)
+ raise

     def close(self):
         self.proc.stdin.close()

Thanks for any help!
"""