Repository: ipython/ipython

Issue:
Crash when starting notebook in a non-ascii path
Ipython crashes when I try to start notebook at a path containging non-ascii characters.

Example with ascii path:

```
C:\python\bugreports\ipython> ipython notebook
[NotebookApp] Using existing profile dir: u'C:\\Users\\jorgenst\\.ipython\\profile_default'
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
[NotebookApp] Use Control-C to stop this server and shut down all kernels.
```

Example with non-ascii path:

```
C:\python\bugreports\ipython\åäö> ipython notebook


ipython-script.py : [NotebookApp] Using existing profile dir: u'C:\\Users\\jorgenst\\.ipython\\profile_default'
At C:\Users\jorgenst\Documents\WindowsPowerShell\profile.ps1:91 char:18
+ ipython-script.py <<<<  $args
    + CategoryInfo          : NotSpecified: ([NotebookApp] U...rofile_default':String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Traceback (most recent call last):
  File "c:\python27\scripts\ipython-script.py", line 9, in <module>
    load_entry_point('ipython==0.13.dev', 'console_scripts', 'ipython')()
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\frontend\terminal\ipapp.py", line 408, in launch_new_instance
    app.initialize()
  File "<string>", line 2, in initialize
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\config\application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\frontend\terminal\ipapp.py", line 308, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\config\application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\core\application.py", line 325, in initialize
    self.parse_command_line(argv)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\frontend\terminal\ipapp.py", line 303, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\config\application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\config\application.py", line 417, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\config\application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\config\application.py", line 356, in initialize_subcommand
    self.subapp.initialize(argv)
  File "<string>", line 2, in initialize
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\config\application.py", line 84, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\frontend\html\notebook\notebookapp.py", line 455, in initialize
    self.init_configurables()
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\frontend\html\notebook\notebookapp.py", line 406, in init_configurables
    self.notebook_manager = NotebookManager(config=self.config, log=self.log)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\traitlets.py", line 412, in __new__
    value.instance_init(inst)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\traitlets.py", line 243, in instance_init
    self.set_default_value(obj)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\traitlets.py", line 263, in set_default_value
    newdv = self._validate(obj, dv)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\traitlets.py", line 311, in _validate
    return self.validate(obj, value)
  File "c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\utils\traitlets.py", line 1012, in validate
    return unicode(value)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 29: ordinal not in range(128)

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True
```



Discussion:
I forgot to add, using master 75fa2b8 on windows 7 python2.7


Resolving patch:
diff --git a/IPython/frontend/html/notebook/notebookmanager.py b/IPython/frontend/html/notebook/notebookmanager.py
--- a/IPython/frontend/html/notebook/notebookmanager.py
+++ b/IPython/frontend/html/notebook/notebookmanager.py
@@ -34,7 +34,7 @@
 
 class NotebookManager(LoggingConfigurable):
 
-    notebook_dir = Unicode(os.getcwd(), config=True, help="""
+    notebook_dir = Unicode(os.getcwdu(), config=True, help="""
         The directory to use for notebooks.
     """)
     


Test patch: