Skip to content

Commit bf32cf3

Browse files
committed
Do not use removesuffix and logging for callable command
1 parent 7f4918d commit bf32cf3

File tree

1 file changed

+10
-3
lines changed
  • jupyter_server_proxy/standalone

1 file changed

+10
-3
lines changed

jupyter_server_proxy/standalone/app.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@ class StandaloneProxyServer(JupyterApp, ServerProcess):
4545

4646
@default("base_url")
4747
def _default_prefix(self):
48-
return os.environ.get("JUPYTERHUB_SERVICE_PREFIX", "/").removesuffix("/")
48+
# Python 3.8 does not support removesuffix
49+
prefix = os.environ.get("JUPYTERHUB_SERVICE_PREFIX", "/")
50+
if prefix[-1] == "/":
51+
prefix = prefix[:-1]
52+
return prefix
4953

5054
@validate("base_url")
5155
def _validate_prefix(self, proposal):
52-
return proposal["value"].removesuffix("/")
56+
prefix = proposal["value"]
57+
if prefix[-1] == "/":
58+
prefix = prefix[:-1]
59+
return prefix
5360

5461
skip_authentication = Bool(
5562
default=False,
@@ -277,7 +284,7 @@ def start(self):
277284

278285
self.log.info(f"Starting standaloneproxy on '{self.address}:{self.port}'")
279286
self.log.info(f"Base URL: {self.base_url!r}")
280-
self.log.info(f"Command: {' '.join(self.command)!r}")
287+
self.log.info(f"Command: {self.command}")
281288

282289
# Periodically send JupyterHub Notifications, that we are still running
283290
if self.activity_interval > 0:

0 commit comments

Comments
 (0)