Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPython no longer handles unicode file names #4256

Closed
aychedee opened this issue Sep 23, 2013 · 9 comments · Fixed by #4257
Closed

IPython no longer handles unicode file names #4256

aychedee opened this issue Sep 23, 2013 · 9 comments · Fixed by #4257
Milestone

Comments

@aychedee
Copy link

As of IPython 1.1.0 this command line:

ipython £ on stock Ubuntu 13.04 creates this stacktrace

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.

@Carreau
Copy link
Member

Carreau commented Sep 23, 2013

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).

@aychedee
Copy link
Author

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.

minrk added a commit to minrk/ipython that referenced this issue Sep 23, 2013
@minrk
Copy link
Member

minrk commented Sep 23, 2013

It's a (wrong) trait validation that wasn't there before on Application.argv. Should be fixed by #4257

@aychedee
Copy link
Author

I can confirm that manually patching my IPython install with patch provided in #4257 fixes this problem.

minrk added a commit that referenced this issue Sep 23, 2013
There was a bad traitlet validation introduced in 1.1

closes #4256
@Carreau
Copy link
Member

Carreau commented Sep 23, 2013

@aychedee For the info I wasn't not trusting you (I'm getting better at double negative). As always the fulltimer on IPython fixes bug before I can fully investigate... (sometime frustrating)

@minrk
Copy link
Member

minrk commented Sep 23, 2013

I tend to hurry when fixing bugs that are my fault.

@Carreau
Copy link
Member

Carreau commented Sep 23, 2013

@minrk Aren't you feeling not uncomfortable to have ≤ than 3 active PR ?

@jdfreder
Copy link
Member

not uncomfortable

😐

@aychedee
Copy link
Author

Of course not @Carreau! I just thought it was my responsibility to make sure that it happened on a clean environment.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants