← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/txpkgupload:py3-bytes-fixes into txpkgupload:master

 

Colin Watson has proposed merging ~cjwatson/txpkgupload:py3-bytes-fixes into txpkgupload:master.

Commit message:
Fix assorted small bytes/text mismatches for Python 3

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/txpkgupload/+git/txpkgupload/+merge/393215
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/txpkgupload:py3-bytes-fixes into txpkgupload:master.
diff --git a/src/txpkgupload/plugin.py b/src/txpkgupload/plugin.py
index a9e9b43..0168643 100644
--- a/src/txpkgupload/plugin.py
+++ b/src/txpkgupload/plugin.py
@@ -161,7 +161,7 @@ class PkgUploadAvatar(LaunchpadAvatar):
         LaunchpadAvatar.__init__(self, user_dict)
         self.fs_root = fs_root
         self.temp_dir = temp_dir
-        self.subsystemLookup["sftp"] = PkgUploadFileTransferServer
+        self.subsystemLookup[b"sftp"] = PkgUploadFileTransferServer
 
 
 @implementer(IRealm)
@@ -191,7 +191,7 @@ def make_portal(authentication_endpoint, fs_root, temp_dir):
     This portal accepts SSH credentials and returns our customized SSH
     avatars (see `LaunchpadAvatar`).
     """
-    authentication_proxy = Proxy(authentication_endpoint)
+    authentication_proxy = Proxy(authentication_endpoint.encode("UTF-8"))
     portal = Portal(Realm(authentication_proxy, fs_root, temp_dir))
     portal.registerChecker(
         PublicKeyFromLaunchpadChecker(authentication_proxy))
diff --git a/src/txpkgupload/tests/test_plugin.py b/src/txpkgupload/tests/test_plugin.py
index c3601c8..162c289 100644
--- a/src/txpkgupload/tests/test_plugin.py
+++ b/src/txpkgupload/tests/test_plugin.py
@@ -327,7 +327,7 @@ class SFTPSession(SSHChannel):
     name = "session"
 
     def channelOpen(self, data):
-        d = self.conn.sendRequest(self, "subsystem", NS("sftp"), wantReply=1)
+        d = self.conn.sendRequest(self, b"subsystem", NS(b"sftp"), wantReply=1)
 
         def _continueSFTP(result):
             client = FileTransferClient()
@@ -437,7 +437,7 @@ class SFTPServer(DeferringFixture):
         self.authserver_listener = reactor.listenTCP(
             0, server.Site(self.authserver))
         self.authserver_port = self.authserver_listener.getHost().port
-        self.authserver_url = b"http://localhost:%d/"; % self.authserver_port
+        self.authserver_url = "http://localhost:%d/"; % self.authserver_port
         self.addCleanup(self.authserver_listener.stopListening)
         self.setUpUser('joe')
         os.mkdir(self.fsroot)