diff options
author | Scott Maxwell <scott@codecobblers.com> | 2013-10-30 17:14:52 -0700 |
---|---|---|
committer | Scott Maxwell <scott@codecobblers.com> | 2013-10-30 17:14:52 -0700 |
commit | 0b7d0cf0a23e4f16f8552ae05a66539119e2e920 (patch) | |
tree | 2ba26a535dceb8b2684adedae99fdbc4c77b3a67 /paramiko/sftp.py | |
parent | 2d738fa08b85c5065cc898d5f9e4d36ee753e871 (diff) | |
download | paramiko-0b7d0cf0a23e4f16f8552ae05a66539119e2e920.tar.gz |
Convert and detect types properly, use helper constants, use StringIO and range
Diffstat (limited to 'paramiko/sftp.py')
-rw-r--r-- | paramiko/sftp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/paramiko/sftp.py b/paramiko/sftp.py index 0d1287a5..11aa3cb4 100644 --- a/paramiko/sftp.py +++ b/paramiko/sftp.py @@ -166,8 +166,8 @@ class BaseSFTP (object): def _send_packet(self, t, packet): #self._log(DEBUG2, 'write: %s (len=%d)' % (CMD_NAMES.get(t, '0x%02x' % t), len(packet))) - out = struct.pack('>I', len(packet) + 1) + chr(t) + packet packet = asbytes(packet) + out = struct.pack('>I', len(packet) + 1) + byte_chr(t) + packet if self.ultra_debug: self._log(DEBUG, util.format_binary(out, 'OUT: ')) self._write_all(out) @@ -183,7 +183,7 @@ class BaseSFTP (object): if self.ultra_debug: self._log(DEBUG, util.format_binary(data, 'IN: ')); if size > 0: - t = ord(data[0]) + t = byte_ord(data[0]) #self._log(DEBUG2, 'read: %s (len=%d)' % (CMD_NAMES.get(t), '0x%02x' % t, len(data)-1)) return t, data[1:] return 0, '' |