Skip to content

Commit 6918bb7

Browse files
authored
Strip newlines from token file
It's common for text editors and shell redirection to generate a file that ends in a newline, which is then extremely difficult, if not impossible, to enter into the browser.
1 parent 6d7109a commit 6918bb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notebook/notebookapp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ def _token_default(self):
995995
if os.getenv('JUPYTER_TOKEN_FILE'):
996996
self._token_generated = False
997997
with open(os.getenv('JUPYTER_TOKEN_FILE')) as token_file:
998-
return token_file.read()
998+
return token_file.read().strip("\n\r")
999999
if self.password:
10001000
# no token if password is enabled
10011001
self._token_generated = False

0 commit comments

Comments
 (0)