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

MinRK benjaminrk@gmail....
Wed Aug 10 15:25:38 CDT 2011


On Wed, Aug 10, 2011 at 07:39, John Reid <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 ]

-MinRK


> 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/301da077/attachment.html 


More information about the IPython-User mailing list