summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-10-18 12:47:03 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-10-18 12:48:46 -0700
commitef83482fce10bf5e80dfbd08d12d5c2b933ad151 (patch)
tree7b342ee0bf1029e4c240c332433c08c4a2f7ef15
parent393fb2fc96d6599ec4cad8d13c7e42470da17abb (diff)
Whoops, can't .format() bytes. Grump grump.
-rw-r--r--paramiko/sftp_server.py4
-rw-r--r--paramiko/util.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/paramiko/sftp_server.py b/paramiko/sftp_server.py
index 5980aadd..f8c4f727 100644
--- a/paramiko/sftp_server.py
+++ b/paramiko/sftp_server.py
@@ -32,7 +32,7 @@ from paramiko.sftp import (
from paramiko.sftp_si import SFTPServerInterface
from paramiko.sftp_attr import SFTPAttributes
from paramiko.common import DEBUG
-from paramiko.py3compat import long, string_types, bytes_types
+from paramiko.py3compat import long, string_types, bytes_types, b
from paramiko.server import SubsystemHandler
@@ -209,7 +209,7 @@ class SFTPServer (BaseSFTP, SubsystemHandler):
# must be error code
self._send_status(request_number, handle)
return
- handle._set_name(b'hx{:d}'.format(self.next_handle))
+ handle._set_name(b('hx{:d}'.format(self.next_handle)))
self.next_handle += 1
if folder:
self.folder_table[handle._get_name()] = handle
diff --git a/paramiko/util.py b/paramiko/util.py
index f72d429c..2854ef98 100644
--- a/paramiko/util.py
+++ b/paramiko/util.py
@@ -117,7 +117,7 @@ def safe_string(s):
if 32 <= i <= 127:
out += byte_chr(i)
else:
- out += b'%{:02X}'.format(i)
+ out += b('%{:02X}'.format(i))
return out