From 0c7de196bd5e33f8372396605a022f7941d5f55b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Tu=C4=8Dek?= Date: Wed, 13 Jun 2018 17:35:57 +0200 Subject: [PATCH] properly handle unicode characters in home dirs --- notebook/notebookapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index e1db9d879e..de93e93f1b 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -212,7 +212,7 @@ def init_settings(self, jupyter_app, kernel_manager, contents_manager, now = utcnow() root_dir = contents_manager.root_dir - home = os.path.expanduser('~') + home = py3compat.str_to_unicode(os.path.expanduser('~'), encoding=sys.getfilesystemencoding()) if root_dir.startswith(home + os.path.sep): # collapse $HOME to ~ root_dir = '~' + root_dir[len(home):]