[IPython-User] 0.11: sys.argv is now unicode
John Reid
j.reid@mail.cryst.bbk.ac...
Wed Aug 10 15:30:21 CDT 2011
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?
Thanks,
John.
More information about the IPython-User
mailing list