[IPython-User] 0.11: sys.argv is now unicode

MinRK benjaminrk@gmail....
Wed Aug 10 15:40:32 CDT 2011


On Wed, Aug 10, 2011 at 13:30, John Reid <j.reid@mail.cryst.bbk.ac.uk>wrote:

> On 10/08/11 21:25, MinRK wrote:
> >
> >
> > On Wed, Aug 10, 2011 at 07:39, John Reid <j.reid@mail.cryst.bbk.ac.uk
> > <mailto:j.reid@mail.cryst.bbk.ac.uk>> wrote:
> >
> >     Hi,
> >
> >     I've switched to 0.11 recently and am very happy with it. One thing I
> >     did notice is that all of sys.argv is now unicode. Is there any way
> to
> >     get back to the old behaviour where sys.argv was string?
> >
> >
> > We have found things to be better behaved when argv is decoded.  You
> > can, of course, encode it right back to bytes with:
> >
> > sys.argv = [ a.encode(sys.stdin.encoding or 'ascii') for a in sys.argv ]
> >
> OK I will try that. I've no doubt unicode is better in general than
> ascii but in my case it broke most of my scripts as they interface to
> C++ libraries that expected ascii. So just to make sure: there's no
> option in ipython to revert the behaviour and no plans to introduce one?
>

None that I know of.  If this does cause problems, we might do something
like put our unicode args in sys.argvu, without fixing sys.argv.


>
> Thanks,
> John.
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110810/b028f256/attachment.html 


More information about the IPython-User mailing list