Repository: ipython/ipython

Issue:
IPython no longer handles unicode file names 
As of IPython 1.1.0 this command line:

`ipython £` on stock Ubuntu 13.04 creates this stacktrace

``` python
Traceback (most recent call last):
  File "/usr/local/bin/ipython", line 9, in <module>
    load_entry_point('ipython==1.1.0', 'console_scripts', 'ipython')()
  File "/usr/local/lib/python2.7/dist-packages/IPython/__init__.py", line 118, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 544, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 312, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/core/application.py", line 362, in initialize
    self.parse_command_line(argv)
  File "/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 307, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", line 463, in parse_command_line
    self.argv = list(argv)
  File "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 315, in __set__
    new_value = self._validate(obj, value)
  File "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 323, in _validate
    return self.validate(obj, value)
  File "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 1215, in validate
    value = self.validate_elements(obj, value)
  File "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 1291, in validate_elements
    return super(List, self).validate_elements(obj, value) File "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 1225, in validate_elements
        v = self._trait.validate(obj, v)
    File "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 1028, in validate
        return unicode(value)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
```

IPython 1.0.0 will just complain that the file does not exist. Or load it if it does. 



Discussion:
This is weird, I don't remember on much changing in thoses lines between 1.0 and 1.1, also this does not seem to crash on master (but with € as I dont know where £ is on my keyboard). 

Just to double check I tried this in a fresh Linux Container, debootstrapped Ubuntu 13.04 with just the minimum of packages to get IPython 1.1.0 installed using pip. Problem still occurred when I ran `ipython €`. So the Euro sign should trigger it. Identical stack trace. Problem goes away if I do `pip install -U ipython==1.0.0` to downgrade. 


Resolving patch:
diff --git a/IPython/config/application.py b/IPython/config/application.py
--- a/IPython/config/application.py
+++ b/IPython/config/application.py
@@ -144,7 +144,7 @@ class Application(SingletonConfigurable):
     version = Unicode(u'0.0')
     
     # the argv used to initialize the application
-    argv = List(Unicode)
+    argv = List()
 
     # The log level for the application
     log_level = Enum((0,10,20,30,40,50,'DEBUG','INFO','WARN','ERROR','CRITICAL'),


Test patch:
diff --git a/IPython/config/tests/test_application.py b/IPython/config/tests/test_application.py
--- a/IPython/config/tests/test_application.py
+++ b/IPython/config/tests/test_application.py
@@ -1,3 +1,4 @@
+# coding: utf-8
 """
 Tests for IPython.config.application.Application
 
@@ -185,4 +186,8 @@ def test_extra_args(self):
         self.assertEqual(app.bar.b, 5)
         self.assertEqual(app.extra_args, ['extra', '--disable', 'args'])
     
+    def test_unicode_argv(self):
+        app = MyApp()
+        app.parse_command_line(['ünîcødé'])
+