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

Ville M. Vainio vivainio@gmail....
Wed Dec 12 13:37:20 CST 2007


On Nov 29, 2007 6:56 AM, pan <nirvana117@gmail.com> wrote:
> And because python2.3 lacks sys.setappdefaultencoding, so have to
> reload(sys), and use sys.setdefaultencoding.
>
> The patch for svn-2875:
>
>  Index: IPython/iplib.py
> +# make converting between str and unicode easy
>  +try:
> +    sys.setappdefaultencoding(sys.stdin.encoding or 'ascii')
>  +except:
> +    # python2.3 does not have sys.setappdefaultencoding
> +    reload(sys)
> +    sys.setdefaultencoding(sys.stdin.encoding or 'ascii')

I have now applied your patch, but I think we should remove such calls
to 'str', making IPython unicode clean for the most parts. That should
not be an overwhelming task...

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


More information about the IPython-user mailing list