[IPython-user] problem with unicode and the compile function in ipython

Fernando Perez fperez.net@gmail....
Tue Nov 27 13:04:57 CST 2007


On Nov 27, 2007 5:47 AM, Ville M. Vainio <vivainio@gmail.com> wrote:
>
> On Nov 27, 2007 2:13 PM, pan <nirvana117@gmail.com> 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 [1]: '<console-default-stdout-encoding of no-ascii characters>'
> > Out[1]: '<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
> think?

I'd say let's get 0.8.2 out (it already has LOTS of unicode
improvements, even if it's not perfect).  We sitll have the funny
business with readline on leopard to worry about, so 0.8.3 will be
coming soon, and that will be a good time to shake out the remaining
unicode issues.

Cheers,

f


More information about the IPython-user mailing list