Skip to content

Commit

Permalink
properly handle unicode characters in home dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
vit-tucek authored Jun 6, 2018
1 parent 459b92c commit 7fe954f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ def init_settings(self, jupyter_app, kernel_manager, contents_manager,

root_dir = contents_manager.root_dir
home = os.path.expanduser('~')
if sys.version_info.major == 2:
home = home.decode(sys.getfilesystemencoding())
if root_dir.startswith(home + os.path.sep):
# collapse $HOME to ~
root_dir = '~' + root_dir[len(home):]
Expand Down

0 comments on commit 7fe954f

Please sign in to comment.