From b74003b8d565ed210563d140b8e3d4b0a4a4186f Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 18 Apr 2017 13:52:00 +0200 Subject: [PATCH] check allow_root after calling super super can dispatch to subcommands such as `list`, etc. we only want to check root *at most* for starting the notebook server itself. --- notebook/notebookapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index a75b7bd58..9e39546d5 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1388,6 +1388,8 @@ class NotebookApp(JupyterApp): This method takes no arguments so all configuration and initialization must be done prior to calling this method.""" + super(NotebookApp, self).start() + if not self.allow_root: # check if we are running as root, and abort if it's not allowed try: @@ -1398,8 +1400,6 @@ class NotebookApp(JupyterApp): self.log.critical("Running as root is not recommended. Use --allow-root to bypass.") self.exit(1) - super(NotebookApp, self).start() - info = self.log.info for line in self.notebook_info().split("\n"): info(line)