Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

exception unicode handling in %run is faulty in qtconsole #535

Closed
jstenar opened this Issue · 6 comments

3 participants

@jstenar
Collaborator

On master 1144388 %running:

# -*- coding: ISO-8859-1 -*-
a=[]
a.apppend(u"åäö")

as a script from the regular ipython console I get:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
C:\python\external\ipy-bugs\run_qtcons_bug.py in <module>()
      2
      3 a=[]
----> 4 a.apppend(u"åäö")

AttributeError: 'list' object has no attribute 'apppend'

from qtconsole I get a long traceback that ends in:

c:\python26\lib\json\encoder.pyc in _iterencode(self, o, markers)
292                     and not (_encoding == 'utf-8')):
293                 o = o.decode(_encoding)
--> 294             yield encoder(o)
295         elif o is None:
296             yield 'null'
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe5 in position 292: invalid continuation byte
@takluyver
Owner

Can you put the full traceback in a pastebin somewhere, and give a link to it?

@takluyver
Owner

OK, I think the issue is that we read the file without worrying about its encoding. That's fine at the terminal, where we can just dump it back out without trying to encode or decode it. It's more complicated for sending it as JSON.

@jstenar jstenar closed this
@jstenar jstenar reopened this
@jstenar
Collaborator

Oops pushed the wrong button. Did not mean to close it.

@takluyver
Owner

This one, at least, I can replicate. I think it may have to wait for an overhaul of the exception handling code, though. In the meantime, ensure that your editor is set to save in UTF-8.

@minrk minrk referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@minrk
Owner

This should be fixed by PR #770

@minrk minrk referenced this issue from a commit in minrk/ipython
@minrk minrk json_clean zmqshell replies
closes gh-535
bc4e206
@minrk minrk was assigned
@minrk minrk closed this
@ellisonbg ellisonbg referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@damianavila damianavila referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
@minrk minrk json_clean zmqshell replies
closes gh-535
1c8d411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.