[IPython-user] problem with unicode and the compile function in ipython
Ville M. Vainio
Tue Nov 27 06:47:19 CST 2007
On Nov 27, 2007 2:13 PM, pan <firstname.lastname@example.org> wrote:
> I tested on windows xp. The built-in compile function, when passed to the
> first <source> argument with unicode string, the <source> would be converted
> to utf8(maybe by python parser). So if the <source> contained no-ascii
> characters, the no-ascii characters would be converted to utf8, and the
> problem would occur like this:
> In : '<console-default-stdout-encoding of no-ascii characters>'
> Out: '<utf8-encoding of no-ascii characters>'
> I suggests to change the codes in runsource in iplib.py:
> "code = self.compile(source,filename,symbol)" to
> "code = self.compile(source.encode(sys.stdout.encoding),filename,symbol)"
If we do this, we definitely need to let the rc wallow for a while.
I'm not strictly opposed to doing it, of course... what do others
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
More information about the IPython-user