Skip to content

Commit 5fc9d78

Browse files
authored
in case of newline at the end of userlist file
It's a habit for some developers to append a newline at the end of the file, but line 82 did not take this into consideration. And the consequence is that JupyterHub would keep restarting.
1 parent 1baac27 commit 5fc9d78

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

jupyterhub_config.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
if not line:
7979
continue
8080
parts = line.split()
81-
name = parts[0]
82-
whitelist.add(name)
83-
if len(parts) > 1 and parts[1] == 'admin':
84-
admin.add(name)
81+
# in case of newline at the end of userlist file
82+
if len(parts) >= 1:
83+
name = parts[0]
84+
whitelist.add(name)
85+
if len(parts) > 1 and parts[1] == 'admin':
86+
admin.add(name)

0 commit comments

Comments
 (0)